occu function - R sesson aborted when using covariates for occupancy

362 views
Skip to first unread message

Dan C

unread,
Aug 11, 2016, 10:03:24 AM8/11/16
to unmarked
Hi all,

I'm using the occu function in unmarked and anytime I attempt to run a model with covariates for occupancy I'm getting a fatal error in R.  The full message that pops up in a dialogue box reads "R session Aborted, R encountered a fatal error, Start New Session".  I'm then forced to reopen R and rerun my code.  The model always runs when I only use covariates of detection.  

I have the current versions of r and Rstudio, reloaded the package and ran models without any NAs.  

Do you have any ideas regarding what's going wrong?

Thanks very much in advance for your time!

Cheers,

Dan Chronowic
M.Sc. Student
Trent University
Environmental and Life Sciences

Richard Chandler

unread,
Aug 11, 2016, 10:04:20 AM8/11/16
to Unmarked package
Hi Dan,

Can you show your code?

Richard

--
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Richard Chandler
Assistant Professor
Warnell School of Forestry and Natural Resources
University of Georgia

Dan C

unread,
Aug 11, 2016, 10:12:21 AM8/11/16
to unmarked, rcha...@warnell.uga.edu


On Thursday, August 11, 2016 at 10:04:20 AM UTC-4, Richard Chandler wrote:
Hi Dan,

Can you show your code?

Richard
On Thu, Aug 11, 2016 at 10:02 AM, Dan C <danielc...@trentu.ca> wrote:
Hi all,

I'm using the occu function in unmarked and anytime I attempt to run a model with covariates for occupancy I'm getting a fatal error in R.  The full message that pops up in a dialogue box reads "R session Aborted, R encountered a fatal error, Start New Session".  I'm then forced to reopen R and rerun my code.  The model always runs when I only use covariates of detection.  

I have the current versions of r and Rstudio, reloaded the package and ran models without any NAs.  

Do you have any ideas regarding what's going wrong?

Thanks very much in advance for your time!

Cheers,

Dan Chronowic
M.Sc. Student
Trent University
Environmental and Life Sciences

--
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Dan C

unread,
Aug 11, 2016, 10:15:49 AM8/11/16
to unmarked
UPSAveg_obs.covs_mod5<-list(old_field_grass_veg,pasture_veg,hay_veg,date2)
UPSAveg_obs.covs_mod5

names(UPSAveg_obs.covs_mod5) <- c("Old Field Grass", "Pasture", "Hay","Date")

UPSA_umf_mod_2014veg_covariates_mod5 <- unmarkedFrameOccu(y=pres_abse2014veg_covariates, siteCovs=NULL, 
                                                          obsCovs=UPSAveg_obs.covs_mod5)   # organize data
UPSA_umf_mod_2014veg_covariates_mod5                    # look at data
summary(UPSA_umf_mod_2014veg_covariates_mod5)            # summarize      
UPSA_occu_mod5_2014veg_covariates<- occu(~ date_order ~ Old_field_grass + Pasture + Hay, UPSA_umf_mod_2014veg_covariates_mod5)  # fit a model
summary(UPSA_occu_mod5_2014veg_covariates)

getP(UPSA_occu_mod5_2014veg_covariates)

The fatal error occurs when I run the third last line of coe with the occu function.

Thanks for your quick reply Richard and thanks in advance for any help that you can give!

Cheers,

Dan

Dan C

unread,
Aug 11, 2016, 10:43:47 AM8/11/16
to unmarked, rcha...@warnell.uga.edu
UPSAveg_obs.covs_mod5<-list(old_field_grass_veg,pasture_veg,hay_veg,date2)
UPSAveg_obs.covs_mod5

names(UPSAveg_obs.covs_mod5) <- c("Old Field Grass", "Pasture", "Hay","Date")

UPSA_umf_mod_2014veg_covariates_mod5 <- unmarkedFrameOccu(y=pres_abse2014veg_covariates, siteCovs=NULL, 
                                                          obsCovs=UPSAveg_obs.covs_mod5)   # organize data
UPSA_umf_mod_2014veg_covariates_mod5                    # look at data
summary(UPSA_umf_mod_2014veg_covariates_mod5)            # summarize      
UPSA_occu_mod5_2014veg_covariates<- occu(~ date_order ~ Old_field_grass + Pasture + Hay, UPSA_umf_mod_2014veg_covariates_mod5)  # fit a model
summary(UPSA_occu_mod5_2014veg_covariates)

getP(UPSA_occu_mod5_2014veg_covariates)

The fatal error occurs when I run the third last line of coe with the occu function.

Thanks for your quick reply Richard and thanks in advance for any help that you can give!

Cheers,

Dan
- show q
On Thursday, August 11, 2016 at 10:04:20 AM UTC-4, Richard Chandler wrote:
Hi Dan,

Can you show your code?

Richard
On Thu, Aug 11, 2016 at 10:02 AM, Dan C <danielc...@trentu.ca> wrote:
Hi all,

I'm using the occu function in unmarked and anytime I attempt to run a model with covariates for occupancy I'm getting a fatal error in R.  The full message that pops up in a dialogue box reads "R session Aborted, R encountered a fatal error, Start New Session".  I'm then forced to reopen R and rerun my code.  The model always runs when I only use covariates of detection.  

I have the current versions of r and Rstudio, reloaded the package and ran models without any NAs.  

Do you have any ideas regarding what's going wrong?

Thanks very much in advance for your time!

Cheers,

Dan Chronowic
M.Sc. Student
Trent University
Environmental and Life Sciences

--
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Richard Chandler

unread,
Aug 11, 2016, 12:26:56 PM8/11/16
to Unmarked package
Hi Dan,

The problem might be that you changed the name of "old_field_grass_veg" to "Old Field Grass" but then you tried to fit the model with a covariate named "Old_field_grass". Try using consistent names and report back. Hopefully it's that simple. Although, even if it is that, unmarked shouldn't have caused R to crash.

Richard


To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Dan C

unread,
Aug 11, 2016, 2:23:19 PM8/11/16
to unmarked, rcha...@warnell.uga.edu
Still no luck.  R is still crashing.  The only difference is that I'm getting the following text in red at the bottom of my console as the R abort dialogue box comes up.  "terminate called after throwing an instance of 'Rcpp::index_out_of_bounds'" "This application has requested a Runtime to terminate it in an unusual way. Please contact the application's support team for more information."

Thanks again for your help Richard!

Dan

Jim Baldwin

unread,
Aug 11, 2016, 9:25:32 PM8/11/16
to unma...@googlegroups.com
Because R didn't give you much to go on, have you tried any of the occu examples that are known to work?  (I'm assuming from your messages that it's crashing with your data and models.)

Jim


To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+unsubscribe@googlegroups.com.

Dan Linden

unread,
Aug 11, 2016, 9:44:00 PM8/11/16
to unmarked
Shot in the dark, but those variable and object names are pretty long.  I wouldn't be surprised if this were causing some obscure error.

Dan C

unread,
Aug 13, 2016, 3:42:44 PM8/13/16
to unmarked
Thanks for all your thoughts and comments everyone.

After a lot of tinkering, I'm finally not getting the fatal error.  However, I'm now getting the error that "Hessian is singular. Try using less covariates".  Is this due to the type of data that I'm using for my covariates?    My covariates are habitat type (area m^2).  Each site has the same area.  However, within a given site there are many zeros.  Could the number of zeros be causing the problem?  

Thanks again in advance for any feedback.

Cheers,

Dan 

James Baldwin

unread,
Aug 13, 2016, 8:22:57 PM8/13/16
to unma...@googlegroups.com
If you add the option "hessian=FALSE" you can probably get rid of the warning but I would generally argue a statistic without a measure of precision is at best of unknown value. 

To get to the cause of the problem, I think you'll need to share data (or at least a subset ) that has the problem. 

Jim

Sent from my iPhone
--

Jim Baldwin

unread,
Aug 14, 2016, 1:49:45 AM8/14/16
to unma...@googlegroups.com
Ooops!  It's "se = FALSE" rather than "hessian = FALSE".  (It's the latter only if you're programming the function optim yourself.)

Jim


To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages