From ripley at stats.ox.ac.uk  Tue Mar  3 10:12:02 2015
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue, 03 Mar 2015 09:12:02 +0000
Subject: [Rd] Import data set from another package?
In-Reply-To: <1e7ee5$5h3fc@ironport10.mayo.edu>
References: <1e7ee5$5h3fc@ironport10.mayo.edu>
Message-ID: <54F57AE2.2050906@stats.ox.ac.uk>

On 02/03/2015 22:48, Therneau, Terry M., Ph.D. 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.

There were some off-the-mark suggestions in this thread.  If you just 
want a dataset from a package, use

data("ergoStool", package = "nlme")

In particular, it is somewhat wasteful to load a large namespace like 
nlme when it is not needed.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK



[Rd] Import data set from another package?
Prof Brian Ripley