[R-pkg-devel] Cascade effect of non-available packages?
Tiago Olivoto
t|@goo||voto @end|ng |rom gm@||@com
Mon Nov 4 11:25:54 CET 2024
Dear Dirk,
Thank you so much for your tips.
I'll implement them and try a new submission.
Best regards,
Olivoto
Em dom., 3 de nov. de 2024 às 14:08, Dirk Eddelbuettel <edd using debian.org>
escreveu:
>
> 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
>
[[alternative HTML version deleted]]
More information about the R-package-devel
mailing list