-
Notifications
You must be signed in to change notification settings - Fork 1
Description
This model used to work in 1.x.x :
m2 <- try(trim(total_number ~ site + year, data=obsTidy, weight=obsTidy$freq, model=3, serialcor=TRUE,overdisp=TRUE))
I noticed that weight is now called weights and had heard that the obsTidy$freq specification was not needed anymore (hence freq should be sufficient)
When I run m2 <- try(trim(total_number ~ site + year, data=obsTidy, weights=obsTidy$freq, model=3, serialcor=TRUE,overdisp=TRUE)), I get the response
"Error in trim.formula(total_number ~ site + year, data = obsTidy, weights = obsTidy$freq, : argument 'weights' should be character"
When I then modify it to:
m2 <- try(trim(total_number ~ site + year, data=obsTidy, weights=freq, model=3, serialcor=TRUE,overdisp=TRUE)), I then get the response
"Error in trim.formula(total_number ~ site + year, data = obsTidy, weights = freq, : object 'freq' not found"
I finally get it working by the unexpected version (guided by the above error stating that 'weights' should be character) :
m2 <- try(trim(total_number ~ site + year, data=obsTidy, weights="freq", model=3, serialcor=TRUE,overdisp=TRUE))
So it looks like the variable name freq is not recognised. BTW obsTidy is a tibble that look like this:
A tibble: 564 x 4
site year total_number freq
1 107 2010 0 0.167
2 107 2011 0 0.5
Best wishes, Lars