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

error in seq.default #1

Open
bonushenricus opened this issue Aug 28, 2023 · 1 comment
Open

error in seq.default #1

bonushenricus opened this issue Aug 28, 2023 · 1 comment

Comments

@bonushenricus
Copy link

Hello
I would try the package to calculate a water budget for a watershed
but there is something wrong
splash.point(sw_in=200, tc=15, pn=10, lat=44,elev=1800,slop=10,asp=270,soil_data=c(sand=44,clay=2,OM=6,fgravel=12))

Error in seq.default(time_index[1], time_index[length(time_index)], "month") :
'from' should be of lenght=1

run1<-splash.point(
  sw_in=Bourne$forcing$sw_in,	# shortwave radiation W/m2
  tc=Bourne$forcing$Ta,		# air temperature C
  pn= Bourne$forcing$P,		# precipitation mm
  lat=Bourne$md$latitude,		# latitude deg
  elev=Bourne$md$elev_m,		# elevation masl
  slop=Bourne$md$slop_250m,	# slope deg
  asp=Bourne$md$asp_250m,		# aspect deg
  soil_data=Bourne$soil, 		# soil data: sand,clay,som in w/w %. Gravel v/v %, bulk density g/cm3, and depth to the bedrock (m)**
  Au=Bourne$md$Aups_250m,		# upslope area m2
  resolution=250.0  			# resolution pixel dem used to get Au
)

Error in if (class(tc) %in% c("xts", "zoo", "ts")) { :
condition has length > 1
Error in exists(cacheKey, where = .rs.CachedDataEnv, inherits = FALSE) :
first argument invalid
Error in if (maxRows != -1 && nrow(data) > maxRows) data <- head(data, :
missing value where TRUE/FALSE is required

@dsval
Copy link
Owner

dsval commented Aug 31, 2023

Hi,
rsplash needs at least one year of data, monthly or daily to do the spin-up, and the dates. The soil data should be a vector of 6 elements. Here is a toy example:
#splash toy
test1<-splash.point(sw_in=200sin(seq(0.01,pi,length.out =365)),
tc=15
sin(seq(0.01,pi,length.out =365)),
pn=rgamma(n=365, shape=5, rate=5),
lat=44,elev=1800,slop=10,asp=270,
soil_data=c(sand=44,clay=2,OM=6,fgravel=12,bd=NA,depth=1),
time_index=seq(as.Date('1800-01-01'),as.Date('1800-12-31'),by='day')
)
Cheers,
David

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