Running occMod crashes my R session

posts related to the RPresence library, which may not be of general interest to users of 'classic' PRESENCE.

Running occMod crashes my R session

Postby ksl59 » Wed Oct 17, 2018 12:27 pm

Hi everyone, I'm new here. Glad to have a place to air my question.

I'm trying to use the most recent version of RPresence on R 3.5.1 via RStudio 1.1.456, on a MacBook Pro running High Sierra. I successfully installed RPresence and created a properly formatted PAO file from point count data. However, when I tried to build my first model using the following code, my R session "encountered a fatal error" and crashed.

hhOcc <- data.frame(matrix(as.numeric(unlist(hhDataL[,2:6])),nrow = 115,ncol = 5))
hhPao <- createPao(hhOcc,title = "HH Occupancy",unitnames = ptL)
psidotpsurvey <- occMod(model=list(psi~1,p~SURVEY),data = hhPao,type = "so")

No error code, nothing to debug. I've also tried R 3.3.3 and rolling back RStudio, with the same problem. Any thoughts?

Yours,
Katherine

Update: I've tried running the example provided in the info file of occMod, and that successfully runs. So clearly something is wrong with my PAO file. My creation process went smoothly, and the input data is a simple 115 sample unit by 5 occasions data frame of ones, zeros, and NAs, so what might be wrong?
ksl59
 
Posts: 6
Joined: Wed Oct 17, 2018 12:00 pm

Re: Running occMod crashes my R session

Postby jhines » Wed Oct 17, 2018 7:27 pm

Hi Katherine,

I can't think of a reason for it not to work. Would you mind sending me your input file and R script?

Jim (jhines@usgs.gov)
jhines
 
Posts: 599
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

Re: Running occMod crashes my R session

Postby ksl59 » Wed Oct 17, 2018 9:09 pm

Hi Jim,

Thanks for your quick reply! I just send you an email with a snippet that reproduces the problem and my input file.

Katherine
ksl59
 
Posts: 6
Joined: Wed Oct 17, 2018 12:00 pm

Re: Running occMod crashes my R session

Postby ksl59 » Wed Oct 17, 2018 11:12 pm

Further update:

I realized that I ran the example from occMod() in the console of RStudio- I did not script it- and then I just tried running my own code in the console, and the R session didn't crash. So, it's an RStudio/RPresence compatibility issue? I'll try an earlier version of RStudio, and if that doesn't work, I'll just run the models through the console manually.
ksl59
 
Posts: 6
Joined: Wed Oct 17, 2018 12:00 pm

Re: Running occMod crashes my R session

Postby ksl59 » Fri Nov 02, 2018 5:09 am

I figured I should post the actual answer to this question- passing a list instead of a character vector to unitnames in createPao() crashes R. Not sure why. But unitnames = as.character(unlist(my.unitnames, use.names = F)) does the trick. My issue was just another case of not closely reading the helpfile until hours after I boarded the struggle bus.
ksl59
 
Posts: 6
Joined: Wed Oct 17, 2018 12:00 pm


Return to RPresence

Who is online

Users browsing this forum: No registered users and 10 guests