You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CRAN complains about missing if(requireNamespace("pkgname")) statements in the package vignettes:
This concerns packages
[... hereR ...]
Suggested packages should be used conditionally: see §1.1.3.1 of 'Writing R Extensions'. Some of these are hard to install on a platform without X11 such as M1 Macs: see the logs at https://www.stats.ox.ac.uk/pub/bdr/M1mac/.
However, using require for conditioning in package code is not good practice as it alters the search path for the rest of the session and relies on functions in that package not being masked by other require or library calls. It is better practice to use code like:
if (requireNamespace("rgl", quietly=TRUE)) {
rgl::plot3d(...)
} else {
## do something else not involving rgl.
}
Note the use of rgl:: as that object would not necessarily be visible (and if it is, it need not be the one from that namespace: plot3d occurs in several other packages). If the intention is to give an error if the suggested package is not available, simply use e.g. rgl::plot3d.
In the vignettes of hereR this is pointing to the mapview, leafpop and ggplot2 packages, which are listed as suggested packages. There seem to be two solutions:
Add the statement above to the vignettes and come up with a fallback solution if the packages are not present.
Remove them from the vignettes and suggested packages in DESCRIPTION and use the fall back solution instead. This would also be preferable with regard to the size of the vignettes.
The text was updated successfully, but these errors were encountered:
CRAN complains about missing
if(requireNamespace("pkgname"))
statements in the package vignettes:According to 1.1.3.1 Suggested packages, the solution is:
In the vignettes of hereR this is pointing to the mapview, leafpop and ggplot2 packages, which are listed as suggested packages. There seem to be two solutions:
DESCRIPTION
and use the fall back solution instead. This would also be preferable with regard to the size of the vignettes.The text was updated successfully, but these errors were encountered: