[Rd] Import data set from another package?

Jeroen Ooms jeroenooms at gmail.com
Tue Mar 3 01:32:02 CET 2015


You could add something like this to your package:

.onLoad <- function(libname, pkgname){
  data(ergoStool, package="nlme", envir = environment(.onLoad));
}

This should basically do the same as importFrom(nlme, "ergoStool") but
then for a lazy load dataset.


On Mon, Mar 2, 2015 at 2:48 PM, Therneau, Terry M., Ph.D.
<therneau at mayo.edu> wrote:
> I've moved nlme from Depends to Imports in my coxme package. However, a few
> of the examples for lmekin use one of the data sets from nlme.  This is on
> purpose, to show how the results are the same and how they differ.
>
>  If I use  data(nlme::ergoStool)  the data is not found,
> data(nlme:::ergoStool) does no better.
>  If I add importFrom(nlme, "ergoStool") the error message is that ergoStool
> is not exported.
>
> There likely is a simple way, but I currently don't see it.
>
> Terry T.
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list