[R] varIdent error using gam function in mgcv

From: niallllll <n.mcginty1_at_nuigalway.ie>
Date: Fri, 18 Jun 2010 10:35:24 -0700 (PDT)


As I am relatively new to the R environment this question may be either a) Really simple to answer
b) Or I am overlooking something relatively simple.

I am trying to add a VarIdent structure to my gam model which is fitting smoothing functions to the time variables year and month for a particular species. When I try to add the varIdent weights to variable Month I get this error returned.

Error in model.frame.default(formula = Chel ~ 1 + M + YM + M + YM, weights = Vf1, :
  variable lengths differ (found for '(weights)')

Here is the simple code I am using.
library(mgcv); library(lattice)
Chel2=gam(Chel~s(M, fx=F, bs="tp")+ s(YM, fx=F, bs="tp")+s(M,YM, fx=F, bs="tp"), family=poisson(link="log"), weights=Vf1) # second GAM with interaction



View this message in context: http://r.789695.n4.nabble.com/varIdent-error-using-gam-function-in-mgcv-tp2260556p2260556.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 18 Jun 2010 - 20:41:31 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 Jun 2010 - 09:20:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive