[R] How to perform package cleanup when R session is ending?
w||||@mwdun|@p @end|ng |rom gm@||@com
Fri Dec 18 16:39:38 CET 2020
Have you tried using reg.finalizer(..., onexit=TRUE)?
On Fri, Dec 18, 2020 at 7:29 AM Jiefei Wang <szwjf08 using gmail.com> wrote:
> I am looking for a way to clean up my package resources before R is ended.
> It looks like the .onUnload function would not be helpful as it would not
> be called before R is ended. This behavior has been described in the
> *Note that packages are not detached nor namespaces unloaded at the end of
> an R session unless the user arranges to do so (e.g., via .Last).*
> I have also searched for ?.Last as the document says. However, the .Last
> function is for the end user to use, not for the package developers, so I
> am clueless now. How to clean up my package before R ends? Any suggestions?
> [[alternative HTML version deleted]]
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help