sjPlot
sjPlot copied to clipboard
get_model_data / tab_model / etc fails for gam models with no smooth terms
tab_model is now working great with mcgv::gam again, but fails in the case where there are no smooths in the gam:
Replicable example:
df<-data.frame(x=rnorm(100),y=rnorm(100),z=rnorm(100))
m1<-mgcv::gam(y~x + s(z),data=df)
m2<-mgcv::gam(y~s(z),data=df)
m3<-mgcv::gam(y~x,data=df)
# Works:
tab_model(m1,m2)
# Fails: Error in rep("smooth_terms", nrow(cs.smooth)) : invalid 'times' argument
tab_model(m3)
Should be an easy fix (testing nrow(cs.smooth)>0 ?)