While following the eBird methodology for single season species occuoancy models I encountered an issue while using the predict function in R, specifically with the predict.averaging function. The function seems to be causing errors for certain model indices ('72', '68', '104', etc.), and I'm also receiving several warnings about missing objects. I suspect the issue might be related to a mismatch between my models and the data I'm trying to predict on.
Here's a brief overview of my setup:
I have a dataset called pred_surface with 883,017 rows and 45 columns of various numeric variables, including longitude, latitude, and others representing land use categories (e.g., pland_01_Coniferous_woodland).
I trained an averaging model named occ_avg using a specific package or library (please specify which one if relevant).
When I try to use the predict function as follows:
occ_pred <- predict(occ_avg, newdata = as.data.frame(pred_surface), type = "state")
I encounter the following error:
Error in predict.averaging(occ_avg, newdata = as.data.frame(pred_surface), : 'predict' for models '72', '68', '104', ... caused errors In addition, there are 21 warnings related to missing objects like 'pland_19_Urban', 'pland_13_Freshwater', and 'pland_20_Suburban'.
I have verified that the variable names in my pred_surface data frame match those used in the model. However, I'm unsure about how to troubleshoot the errors and warnings I'm encountering.
What could be causing the errors with the specific model indices? How can I address the warnings about missing objects, even though these variables are present in the pred_surface data frame?
Please comment if any more info is needed to understand the problem, I tried to be as descriptive as I can but I may have just confused you more. I'm new to the unmarked package for single season occupancy and am on a tight time limit to hand in the final prediction in 3 weeks to the day!
Thanks for understanding!
I can also set up a Github with full datasets if that would also be helpful.