[R-pkg-devel] Cascade effect of non-available packages?
Dirk Eddelbuettel
edd @end|ng |rom deb|@n@org
Sun Nov 3 18:08:52 CET 2024
Tiago,
Looking at https://www.stats.ox.ac.uk/pub/bdr/noSuggests/pliman.out
we see it errors after trying '* checking examples ...':
* checking examples ... ERROR
Running examples in ‘pliman-Ex.R’ failed
The error most likely occurred in:
> ### Name: as_image
> ### Title: Create an 'Image' object
> ### Aliases: as_image
>
> ### ** Examples
>
> img <-
+ as_image(rnorm(150 * 150 * 3),
+ dim = c(150, 150, 3),
+ colormode = 'Color')
Error in loadNamespace(x) : there is no package called ‘EBImage’
Calls: as_image ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
* checking PDF version of manual ... [12s/12s] OK
Looking at as_image.Rd in https://github.com/NEPEM-UFSC/pliman/blob/24a1781073f9b1a3141002f0985b0542b1f7178d/man/as_image.Rd
we see that you do have an \donttest{} there but that alone does not protect
you. Instead of
\examples{
\donttest{
library(pliman)
img <-
as_image(rnorm(150 * 150 * 3),
dim = c(150, 150, 3),
colormode = 'Color')
plot(img)
}
I would do something like
if (interactive() && requireNamespace("EBImage", quietly=TRUE)) {
library(pliman)
img <- as_image(rnorm(150 * 150 * 3), dim = c(150, 150, 3), colormode = 'Color')
plot(img)
}
where you could of course put that condition into a helper function.
Hope this helps, Dirk
--
dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
More information about the R-package-devel
mailing list