Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch test/example dataset #248

Open
martinju opened this issue Jan 22, 2021 · 1 comment
Open

Switch test/example dataset #248

martinju opened this issue Jan 22, 2021 · 1 comment

Comments

@martinju
Copy link
Member

CRAN requires all packages under Suggests to be used conditionally in all code, ref #246
Since we use the MASS package for lots of examples and tests, we need to add the cumbersome if(requireNamespace("MASS") outside all this code. By switching to using a dataset in the "datasets" package which is part of core R we can probably avoid this, as it does not seem necessary to add this package under suggests. (Possibly by mistake) we currently don't have it under Suggests, while we still use it in a test without the requireNamespace stuff see

# Data -----------
data("iris", package = "datasets")
x_var <- c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width")

Should make sure we don't need the datasets package under depends before doing this switch

@martinju
Copy link
Member Author

At least anova.lm from the stats package use LifeCycleSavings from the datasets package in an example without any requireNameSpace stuff, see: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/anova.lm.html
It is neither mentioned in stats DESCRIPTION https://stat.ethz.ch/R-manual/R-devel/library/stats/DESCRIPTION

Thus, I think we can safely do the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant