USGS-R / RSPARROW

A system of R scripts and functions for executing and evaluating SPARROW surface water-quality models that generates graphical, map, and tabular output.
Other
25 stars 13 forks source link

Error in runing RSPARROW #7

Open ShuaiGe57 opened 2 years ago

ShuaiGe57 commented 2 years ago

Hello! how to fix this problem

source("F:/R_user/RSPARROW/UserTutorial/results/sparrow_control.R") ℹ Loading RSPARROW Did you save the active control file F:\R_user\RSPARROW\UserTutorial\results\sparrow_control.R and all '*.csv' control files?

1: Yes, I have saved all control files. Continue the current run. 2: No, I haven't saved all control files. Cancel current run.

Selection: 1 Error in if (class(setting) == "character" | is.na(setting)) { (from testSettings.R#58) : the condition has length > 1

Traceback: 10: testSettings(settings, saved) at executeRSPARROW.R#102 9: executeRSPARROW(settingValues = lapply(settingsEnv, get), settingNames = settingsEnv, activeFile, envir = .GlobalEnv) at runRsparrow.R#68 8: eval(ei, envir) 7: eval(ei, envir) 6: withVisible(eval(ei, envir)) 5: source(paste(path_master, "/R/runRsparrow.R", sep = "")) at sparrow_control.R#699 4: eval(ei, envir) 3: eval(ei, envir) 2: withVisible(eval(ei, envir)) 1: source("F:/R_user/RSPARROW/UserTutorial/results/sparrow_control.R")

RSPARROW SYSTEM ERROR OCCURRED To reset user options in R use options(backupOptions)

emm-terra commented 2 years ago

I'm having the same issue as well, following.

emm-terra commented 1 year ago

@ShuaiGe57 If you were not running RSPARROW on R version 3.5.0, that may fix the problem. It worked for me.

ShuaiGe57 commented 1 year ago

use R version 4.0.3

JYJCARD commented 7 months ago

this is because setting's length is larger than 1 like setting = c('huc2','huc4'). R can not work with the condition (is.na(setting)), you can just replace is.na with sum(is.na(setting)).