From h.wickham at gmail.com  Sat Dec  7 21:35:53 2013
From: h.wickham at gmail.com (Hadley Wickham)
Date: Sat, 7 Dec 2013 14:35:53 -0600
Subject: [Rd] Depending/Importing data only packages
In-Reply-To: <52A37F9A.1010106@gmail.com>
References: <CABdHhvEXM_Bbr7GXP0nRiURCGfVzcFXOi--9sLUiBe3YrdP-qQ@mail.gmail.com>
	<52A37F9A.1010106@gmail.com>
Message-ID: <CABdHhvEK4Aq8DLhifTbtE5FDSG1yjFfcsKw0MATye_ETOWi5CA@mail.gmail.com>

> I don't know whether the author of that note would consider it spurious or
> not.   A simple workaround for you (as the author of hflights) is to put a
> function into the namespace.  For example, get_hflights(), that gets a copy
> of the data:
>
> get_hflights <- function() {
>   data("hflights", package="hflights", envir=environment())
>   hflights
> }

Another option is to put it in sysdata.rda and then export it - but
then (I think) you don't get the nice lazy loading.  It would be nice
to have some official guidance on what is preferred.

Hadley

-- 
http://had.co.nz/



[Rd] Depending/Importing data only packages
Hadley Wickham