[R] Package creation - require statement?

Charlie Sharpsteen chuck at sharpsteen.net
Sun Dec 20 00:12:34 CET 2009


On Fri, Dec 18, 2009 at 3:50 PM, Jeff Breiwick <Jeff.Breiwick at noaa.gov> wrote:
> Thanks for you advice.  I do, in fact, have a call to RODBC in my function
> that uses RODBC functions. The first line of that function is
> require(RODBC). The odd thing is if I leave off ROBDC from the DESCRIPTION
> file then rcmd check pkgname completes and gives me a warning about RODBC.
> However, I can install the package and it works. But if I include RODBC in
> the Depends: line of DESCRIPTION, the check bombs shortly after the Depends
> line.
>
> Jeff Breiwick

Hmm, try placing an .onLoad() function in your package and moving the
call to require() inside of it-- you may have to have it there.

=Charlie




More information about the R-help mailing list