[R] .Last() and namespace

Ralf Tautenhahn rtautenh at ipb-halle.de
Mon Jul 14 17:46:14 CEST 2008

Dear R-help list,

 for a package that uses Rmpi calls and a namespace,
 I need to define a .Last()  function to call mpi.finalize() - directly
before R quits.

 The hooks like on .onUnload  are not useful in this case, because they
are not executed when the R session is finished.
 The defined .Last() must be in the base namespace to be executed, is
there a better way  to do this  than this hack :

  eval(expr=".Last" <- function() mpi.finalize(), envir =
.BaseNamespaceEnv)   ?



More information about the R-help mailing list