jeffreyevans/spatialEco

Unconditional use of package `rms`

rubak opened this issue · 5 comments

rubak commented

spatialEco only Suggests the package rms, but R CMD check fails without this package installed since it is called unconditionally in the examples of logistic.regression. Maybe you would consider wrapping the example in a condition that ensures that it only runs if rms is present?

rubak commented

The same goes for tabularaster and exactextractr. I'm setting up a new reverse dependency checker for the spatstat family of packages and that is why I'm noticing these. If you don't want to wrap these examples in conditionals it is not a big issue for me. I just wanted to let you know.

rubak commented

It is happening when the checker goes through the examples of the package on a system that doesn't have e.g. rms installed. So you for example need to replace require(rms) with if(requireNamespace(rms, quietly = TRUE)){ here:

#' require(rms)

and then a } towards the end of the examples section when rms is no longer necessary.

rubak commented

In terms of automatic checking of examples it would be better if the example doesn't generate the error stop("Can't run examples, please install ", paste(p[m], collapse = " ")) when missing suggested package(s). Could you replace the stop with a message or something like that so it doesn't generate an error and stop further processing of examples?

Anyway, it is just a suggestion and by now I have installed the suggested packages on my reverse dependency checker so it doesn't cause problems for me any more.

Best,
Ege