[R-pkg-devel] why can't we importFrom 'methods' ?

Martin Morgan m@rtin@morg@n @ending from ro@wellp@rk@org
Thu May 17 18:45:29 CEST 2018



On 05/17/2018 11:59 AM, Duncan Murdoch wrote:
> On 17/05/2018 11:51 AM, Brian G. Peterson wrote:
>> newer versions of R require importFrom for functions from 'stats',
>> 'graphics' and many other packages that used to be assumed to be on the
>> search path and thus available.
>>
>> 'methods' continues to have seemingly different treatment.
>>
>> If you try to use importFrom to import a single function (in this case
>> 'hasArg') from methods, you receive an ERROR from R CMD check
>>
>>      Namespace dependency not required : 'methods'
> 
> That message usually means that you didn't list 'methods' in the Imports 
> clause in DESCRIPTION.

Is there a better way of formulating the message?

   Packages used in the NAMESPACE file must also be in the Imports: or 
Depends: field of the DESCRIPTION file; missing packages : 'methods'

   Package(s) not present in Imports: or Depends: of DESCRIPTION :
       'methods'

    ... ?

Martin Morgan

> 
> Duncan Murdoch
> 
>>
>> but without the importFrom, you see a number of NOTE's
>>
>>      no visible global function definition for 'hasArg'
>>
>> I don't want to import all of 'methods', as I only need one function.
>>
>> What am I doing wrong?
>>
>> Regards,
>>
>> Brian
>>
> 
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel


This email message may contain legally privileged and/or...{{dropped:2}}



More information about the R-package-devel mailing list