Dear colleagues,
I was wondering if someone could help me with the use of RPresence. Recently, I was using a script provided by Dr. Koustubh Sharma from the Snow Leopard Network regarding occupation models and, by some reason that I can´t explain, RPresence is no longer working. After running the line of the script that runs the null model, R gives me the following message:
Error in .C("rpresence", argi(a$nunits), argi(a$nsurveys), argi(a$nseasons), :
"rpresence" not resolved from current namespace (RPresence)
Does anybody knows how to deal with this error? Is it related to some previous version of R?
Thank you.
SCRIPT:
install.packages("RPresence", repo="https://www.mbr-pwrc.usgs.gov/mbrCRAN")
library(RPresence) #load RPresence. Use install.packages(RPresence) if not installed already
library(ggplot2) #load ggplot package. Use install.packages(ggplot2) if not installed already
setwd("C:/Distribution models PAWS/data")
# load detection history data from the Find 8s exercise
Find8.hist2<-read.csv("Find8_2survey_dets.csv", header = TRUE)
Find8.hist2.det<-ifelse(Find8.hist2[,c(2,3)]>0,1,0)
# look at first few records to be sure all is ok
head(Find8.hist2.det)
# create pao data object using 8s' detection history and NO covariates
Find8.data2<-createPao(data= Find8.hist2.det) #exclude the first column for pao
# Check the first five rows of the detection data
tail(Find8.data2$det.data)
# fit psi(.)p(.) or null model on Find 8s data
Find8.2.null<-occMod(model = list(psi~1, p~1), data = Find8.data2, type = "so")