Hi -
I am trying to make abundance predictions for bat species in Missouri. I have my top model and when I try to use the 'predict' fuction - I get an error
"Error: ncol(coefficients) == length(obj@estimates) is not TRUE"
This is the code I am using and I am attaching the csv file I am importing into R:
predict_PESUgraph <-read.csv("G:/Chapter3/PESU_pred.csv")
str(predict_PESUgraph)
predictions_PESUG <-predict(pesu.H4, newdata=predict_PESUgraph, type="state", appendData=TRUE)
write.csv(predictions_PESUG, "CG:/Chapter3/PESU_pred_abund.csv")
Also- this is my top model and my unmarked dataframe:
pesu.H4<- multinomPois(~p ~SW1k+For1k+yr, data=pesudf)
###### Make the unmarked dataframe
pesudf <- unmarkedFrameMPois(y=y2,
siteCovs=data.frame(yr, canopy, under, TPH11, TPH5, TPHs, edge, YRsinceB,
FirePlot, Pprey, open1k, SW1k, For1k, pburned, FFreq1km, open16, urban16, forest16),
obsCovs=list(etemp=etemp, w=w, jul=jul, p=p, moon=moon, year=year),
type="removal") #'obsToY' is created automatically, piFun is also created automatically
str(pesudf)
summary(pesudf)
Thanks!
Kathryn