Listing Packages in Depends or Imports

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Listing Packages in Depends or Imports

Dario Strbenac-2
Hello,

The Writing R Extensions manual gives confusing advice. Compare

Packages listed in imports or importFrom directives in the NAMESPACE file should almost always be in ‘Imports’ and not ‘Depends’.

with

Almost always packages mentioned in ‘Depends’ should also be imported from in the NAMESPACE file

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Listing Packages in Depends or Imports

barry rowlingson
On Fri, Jun 27, 2014 at 3:00 AM, Dario Strbenac
<[hidden email]> wrote:
> Hello,
>
> The Writing R Extensions manual gives confusing advice. Compare
>
> Packages listed in imports or importFrom directives in the NAMESPACE file should almost always be in ‘Imports’ and not ‘Depends’.
>
> with
>
> Almost always packages mentioned in ‘Depends’ should also be imported from in the NAMESPACE file

 Why is that confusing? Its perfectly logical.

 First line says that packages imported in the NAMESPACE should
usually be in "Imports" in the DESCRIPTION. It implies there are
special cases when "Depends" may be correctly used.

 Second line is that packages that are listed as Depends in
DESCRIPTION should usually be imported in the NAMESPACE file, but
implies there may be exceptions - you might correctly have a "Depends"
that doesn't have an import in the NAMESPACE.

In themselves, those two statements are perfectly logical and consistent.

As an attempt to explain **when** you'd put a reference in Depends or
Imports or why you'd use one of those get-out exceptions, it makes no
claims!

Barry

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Listing Packages in Depends or Imports

Uwe Ligges-3
In reply to this post by Dario Strbenac-2


On 27.06.2014 04:00, Dario Strbenac wrote:

> Hello,
>
> The Writing R Extensions manual gives confusing advice. Compare
>
> Packages listed in imports or importFrom directives in the NAMESPACE file should almost always be in ‘Imports’ and not ‘Depends’.
>
> with
>
> Almost always packages mentioned in ‘Depends’ should also be imported from in the NAMESPACE file
>


Right. In the DESCRIPTION file, you should try to be in "Imports" only,
but even you have to declare in "Depends", you still need to import with
appropriate directives in the NAMESPACE file.

Best,
Uwe Ligges



> --------------------------------------
> Dario Strbenac
> PhD Student
> University of Sydney
> Camperdown NSW 2050
> Australia
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Listing Packages in Depends or Imports

Dario Strbenac-2
In reply to this post by barry rowlingson
Hello,

What I meant was that the second rule implies that Depends packages should be in the NAMESPACE file, but the first rule implies that packages in the NAMESPACE file should not be in the Depends field, but Imports field. It would be a logical contradiction if it wasn't preceded by "almost always".

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel