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

preProcess fails when terra not installed and fun = NA #393

Open
CeresBarros opened this issue Jun 4, 2024 · 1 comment
Open

preProcess fails when terra not installed and fun = NA #393

CeresBarros opened this issue Jun 4, 2024 · 1 comment

Comments

@CeresBarros
Copy link
Member

This is a terrible reprex, but more so I don't forget about it:

remove.packages("terra")
repos <- c("predictiveecology.r-universe.dev", getOption("repos"))
install.packages(c("SpaDES.project", "googledrive", "reproducible"), 
                 repos = repos)
library(SpaDES.project)

## get Castor modules and functions
setupFunctions(paths = list("projectPath" = "~/"),
               functions = c("PredictiveEcology/PredictiveEcology.org@main/tutos/castorExample/getCastorModulesAndDB.R",
                             "PredictiveEcology/PredictiveEcology.org@main/tutos/castorExample/params.R"),
               overwrite = TRUE)
outMod <- getCastorModulesAndDB(paths = list("modulePath" = "~/tutos/castorExample/modules/",
                                             "projectPath" = "~/tutos/castorExample"),
                                modules = c("dataCastor", 
                                            "growingStockCastor", 
                                            "forestryCastor", 
                                            "blockingCastor"),
                                dbURL = "https://drive.google.com/file/d/1-2POunzC7aFbkKK5LeBJNsFYMBBY8dNx/view?usp=sharing",
                                dbPath = "~/tutos/castorExample/R/scenarios/comparison_stsm")

tracked down to:

Browse[3]> 
debug: feKnown <- .fileExtsKnown()
Browse[3]> 
Error in loadNamespace(x) : there is no package called ‘terra’
debug: unlink(.tempPath, recursive = TRUE)
@achubaty
Copy link
Collaborator

achubaty commented Jun 7, 2024

Isn't this an issue with SpaDES.project, rather than reproducible? If terra is removed, then reproducible (re)installed (with dependencies = TRUE to get the suggested packages, including terra), then it should pick up the suggested terra dependency.

THat said, this may suggest a problem with the conditional use of terra.

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

No branches or pull requests

2 participants