Fungsi-fungsi ini memungkinkan pengguna untuk mengatur tindakan yang harus diambil sebelum paket dilampirkan/dilepas dan namespace (tidak) dimuat.
getHook(hookName)
setHook(hookName, value,
action = c("append", "prepend", "replace"))<p></p><p>packageEvent(pkgname,
event = c("onLoad", "attach", "detach", "onUnload"))</p>
| Parameter | Deskripsi |
|---|---|
hookName |
character string: the hook name |
pkgname |
character string: the package/namespace name |
event |
character string: an event for the package. Can be abbreviated. |
value |
A function or a list of functions, or for action = "replace", NULL |
action |
The action to be taken. Can be abbreviated. |
# NOT RUN {
setHook(packageEvent("grDevices", "onLoad"),
function(...) grDevices::ps.options(horizontal = FALSE))
# }