[R-pkg-devel] f319

Jendoubi Bedhiafi, Takoua t@jendoub|14 @end|ng |rom |mper|@|@@c@uk
Tue Dec 22 05:45:39 CET 2020


I am out of office with occasional email access until the new year.

On 25 Jul 2019, at 21:49, Roy Mendelssohn - NOAA Federal via R-package-devel <r-package-devel using r-project.org> wrote:

Thanks,  actually have similar code for some other packages that must have been causing similar problems  (that part was from the original author,  I am now the maintainer).  Now I understand why he had something similar in the code.  There is a comment about Namespaces not being handled properly in those packages.

Will try that.  I actually have rgdal and rgeos in Imports,  they were getting flagged in the CRAN nightly builds.  If I have them in that one statement,  that should take care of both issues I believe.

But it would be nice to figure out why this is happening,  and only on Windows.  Sort of frustrating when you follow the guidelines but get failures,  but what also what is good about things like CRAN,  for whatever reason this will insure I work across platforms.

-Roy


On Jul 25, 2019, at 12:56 PM, Duncan Murdoch <murdoch.duncan using gmail.com> wrote:

On 25/07/2019 3:47 p.m., Roy Mendelssohn - NOAA Federal wrote:
Okay I added rgeos but now it can't find rgdal.  as in:
Error: processing vignette 'using_plotdap.Rmd' failed with diagnostics:
package 'rgdal' is not available
--- failed re-building 'using_plotdap.Rmd'

A question I asked before is if there is anyway to check that 'rgdal' and 'rgeos' are properly installed on the winbuider servers, as well as 'sf' and 'sp'?  'devtools::check()' on my mac produces no errors,  same with  'rhub' using Fedora,  but I get the same errors on 'rhub' using Windows.    So it appears to be a problem with Windows,  and again I am not calling these packages directly so I should not need to Import them.

You're right, you shouldn't need to import them if you don't call them directly.  However, if some package that you do need requires them, then your build or checks will fail without them.

It's probably getting tedious, but you could work around this as well, by figuring out what part of using_plotdap.Rmd needs rgdal, and wrapping that code in something like

if (requireNamespace("rgdal")) {
# code that needs it
}

I think this will mean you need to add rgdal to the Suggests list for your package to avoid other warnings.

Duncan Murdoch

Thanks,
-Roy
On Jul 25, 2019, at 12:38 PM, Duncan Murdoch <murdoch.duncan using gmail.com> wrote:

On 25/07/2019 3:21 p.m., Roy Mendelssohn - NOAA Federal via R-package-devel wrote:
I have been testing a package for resubmission with bug fixes.  On the present CRAN builds I get:
Result: NOTE
   Namespaces in Imports field not imported from:
    ‘mapdata’ ‘maptools’ ‘plot3D’ ‘rgdal’ ‘rgeos’
    All declared Imports should be used.
However,  if I remove rgeos from the imports I get from win builder:
Error in st_as_sfc.SpatialPolygons(sp::geometry(x), ...) :
    package rgeos required for finding out which hole belongs to which exterior ring
Note that I am not calling 'rgeos',  either 'sf' or 'sp' is,  but does not appear to be properly importing all the need namespaces.
Best way  to proceed?  Include rgeos in Import and get the Note,  or ????

A simple workaround would be to add a function that calls something from rgeos just to satisfy the check, e.g.

# Just to satisfy the checks...
dummy <- function() rgeos::getScale()

I don't think there are warnings if dummy is never used or exported, but if there are, I think that's a pretty harmless call to make.

Duncan Murdoch
**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn using noaa.gov www: http://www.pfeg.noaa.gov/
"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected"
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.


**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn using noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected"
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.

______________________________________________
R-package-devel using r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list