On 9/28/07, Søren Højsgaard <[EMAIL PROTECTED]> wrote: > Dear List > > In a package I want to import the mApply function from the Hmisc package, and > I would like to import only that function. > > 1) If I write "Depends: Hmisc" in the DESCRIPTION file I get the whole Hmisc > package, so that is not the way to go ahead. > > 2) According to "Writing R extensions", sec 1.6.1 "Specifying imports and > exports" I can (as I read it) simply type Hmisc:::mApply(....) in my code. > That works, but gives a warning in the check: > > * checking for unstated dependencies in R code ... WARNING > '::' or ':::' imports not declared from: > Hmisc > > 3) According to the same section I can (again as I read it) write in the > NAMESPACE file > importFrom(Hmisc,mApply) > > Then I get: > > * checking package dependencies ... ERROR > Namespace dependencies not required: > Hmisc > > That message goes away if I write "Depends: Hmisc" in DESCRIPTION, but then > we are back to 1) where I started where the whole Hmisc package is loaded. > > Obviously I have missed a point or two somewhere. Can anyone enlighten me?
For both 2) and 3), the correct DESCRIPTION entry is Imports: Hmisc And for 2), you should be able to use Hmisc::mApply (i.e., 2 colons, not 3), although 3) is preferred. -Deepayan ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.