Skip to content
Prev 11152 / 12125 Next

[R-pkg-devel] Removing packages files

On 2025-01-02 9:55 a.m., Llu?s Revilla wrote:
Yes, those are described in section "1.5.3 Load hooks" of writing R 
extensions:

"Packages can use a .onDetach or .Last.lib function (provided the latter 
is exported from the namespace) when detach is called on the package. It 
is called with a single argument, the full path to the installed 
package. There is also a hook .onUnload which is called when the 
namespace is unloaded (via a call to unloadNamespace, perhaps called by 
detach(unload = TRUE)) with argument the full path to the installed 
package?s directory. Functions .onUnload and .onDetach should be defined 
in the namespace and not exported, but .Last.lib does need to be exported."

Duncan Murdoch