# There are 3 factors to mixture (eg 3 crops): A, B, C.
# There are 3 climate scenario factors.
bam2 <- mgcv::gam(Vha~s(Age,by=Mixture)+ # Expected Age decline of crop.
s(climate,Year,by=Mixture,bs="fs")+ # Factor smooth of climate and year captures accumulate effects during simulations of plots.
s(Plot,PlotReplicate,bs="re")+ #Random effects distinguishing plots.
Mixture, #Mixture intercepts.
data=combined_data,
family="gaussian",
method="REML")
bam2smooths <- gratia::smooth_estimates(bam2)
When I'm hit by a :
Error in seq.default(from = min(x, na.rm = TRUE), to = max(x, na.rm = TRUE), :
'length.out' must be a non-negative number
I have gotten so far with the debug that I can point to something going wrong in the sequence:
smooth_estimates.gam LOC 26.
When i hits 4L and tries to evaluate eval_smooth. it fails.
eval_smooth.fs.interaction LOC 9.
model is a Large gam 59 elements, 27.8 MB.
smooth is a Large fs.interaction (38 elements, 4.6 MB)
by_var = "Mixture"
data =NULL
id= 4L
What is climate here? It sounds like (from what you wrote) this is a factor which would be wrong for the fs smooth which is s(x, f), i.e. continuous covariate first.
Hi!
I'm attempting the following:
When I'm hit by a :
Grabbing by name or index for 1:3 works fine.
I have gotten so far with the debug that I can point to something going wrong in the sequence: