Page 1 of 1

RPresence

PostPosted: Sat Aug 19, 2023 8:16 pm
by Azevedo
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")

Re: RPresence

PostPosted: Sat Aug 19, 2023 10:52 pm
by jhines
Hi, sorry for the problem. There was a packaging error in the latest version of RPresence (2.13.50), which I fixed and uploaded Friday evening. Please download again and let me know if you have problems.

Jim

Re: RPresence

PostPosted: Sun Aug 20, 2023 9:47 am
by Azevedo
Hi Jim,
Thank you for your answer and attention to this matter.
I have downloaded the package RPresence again, and it is still not running properly. I've gotten the same message:
Error in .C("rpresence", argi(a$nunits), argi(a$nsurveys), argi(a$nseasons), :
"rpresence" not resolved from current namespace (RPresence)

Is there any specific R version that I should use? Is it related to RStudio version? I am kind of lost into this matter.
Best,
Fernando

Re: RPresence

PostPosted: Mon Aug 21, 2023 9:39 am
by jhines
Hi Fernando,

It's possible our timing was off and you downloaded the package before I updated. To make sure you have the most recent version, it should print the version number (2.13.51) when the package loads (library RPresence). If you get an error after downloading again, please let me know.

Jim

Re: RPresence

PostPosted: Mon Aug 21, 2023 9:56 am
by Azevedo
Dear Jim and colleagues,

I've finaly fixed my problem. What I had to do was to create a folder where presence should be stored. This folder was the same as the one where RPresence was installed. Then it worked again.
Thank you for your help.
Best,
Fernando


presence='C:/Users/Dell/rpacotes';
presence
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

Re: RPresence

PostPosted: Tue Aug 22, 2023 6:47 am
by Azevedo
Hi Jim and colleagues again,

It seems that your upadate has worked out. After you updated the package, even when the program is not downloaded onto the same folder as it was installed, it has worked properly.

Thank you again,

Fernando