[Rd] Style question
Hadley Wickham
h.wickham at gmail.com
Fri May 30 16:06:35 CEST 2014
> Even more important than choosing between whatever(...)
> or foo::whatever(...), you should import that function
> from the foo package by putting
>
> importFrom(foo, whatever)
>
> or
>
> import(foo)
>
> in your NAMESPACE file.
>
> The 1st form also kind of document what function comes from what
> package.
>
> Note that you'll also need to have foo in the Depends or Imports field
> of your DESCRIPTION file. Which field is appropriate depends on whether
> or not you want foo to show up in the user's search path when s/he loads
> your package with 'library(yourpackage)'.
Except that if you do foo::whatever() you don't need to explicitly
import the function.
Hadley
--
http://had.co.nz/
More information about the R-devel
mailing list