From murdoch.duncan at gmail.com  Sat Dec  7 21:05:46 2013
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Sat, 07 Dec 2013 15:05:46 -0500
Subject: [Rd] Depending/Importing data only packages
In-Reply-To: <CABdHhvEXM_Bbr7GXP0nRiURCGfVzcFXOi--9sLUiBe3YrdP-qQ@mail.gmail.com>
References: <CABdHhvEXM_Bbr7GXP0nRiURCGfVzcFXOi--9sLUiBe3YrdP-qQ@mail.gmail.com>
Message-ID: <52A37F9A.1010106@gmail.com>

On 13-12-06 4:20 PM, Hadley Wickham wrote:
> Hi all,
>
> What should you do when you rely on a data only package. If you just
> "Depend" on it, you get the following from R CMD check:
>
> Package in Depends field not imported from: 'hflights'
>    These packages needs to imported from for the case when
>    this namespace is loaded but not attached.
>
> But there's nothing in the namespace to import, so adding it to
> imports doesn't seem like the right answer.  Is that just a spurious
> note?
>
> Hadley
>

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
}

I don't know a simple workaround for someone who depends on a data-only 
package that they did not author.

Duncan Murdoch



[Rd] Depending/Importing data only packages
Duncan Murdoch