fx.total error

148 views
Skip to first unread message

cbpozz...@alaska.edu

unread,
Jun 19, 2015, 6:43:35 PM6/19/15
to secr...@googlegroups.com
Hello all, I have what I hope will be an easy question. I am trying to produce a surface of coyote activity centers using fx.total() and I am getting an error that I can't figure out. here is the simple line of code that I have tried to run and the error it produces:

> fxsurface <- fx.total(foxs_null, sessnum=2)
 
Error in fx.total(foxs_null, sessnum = 2) : not for ms model

At first I thought that the "ms" might mean multisession, but you can see that I added in the sessnum argument and still got the error. Anyone know what this error is trying to tell me? Thanks!

Casey

Murray Efford

unread,
Jun 19, 2015, 8:15:06 PM6/19/15
to secr...@googlegroups.com, cbpozz...@alaska.edu
Hi Casey
'ms' really does refer to multisession models (there's even a function ms that tests for whether a model fit or capthist object is multisession). What you stumbled on was an inconsistency in the code: it seemed to let you specify a sessnum for multisession data, then spat it out if you tried. Whoever wrote this **** didn't finish the job. I have rushed through a change that should make it work as expected (see working version 2.9.6 at www.otago.ac.nz/density/SECRinR.html). At least I can do
library(secr)
fxsurface
<- fx.total(ovenbird.model.D, sessnum=3)
plot
(fxsurface, covariate = 'D.sum')

and get a meaningful plot, or at least as meaningful as one ever gets from fx.total. Note the need to specify covariate = 'D.sum' (the default D.0 fails).
Thanks for reporting this, and let me know if there are further problems.
Murray

cbpozz...@alaska.edu

unread,
Jun 23, 2015, 8:19:19 PM6/23/15
to secr...@googlegroups.com, cbpozz...@alaska.edu
Thanks for the response, Murray. The fix has allowed me to run fx.total() with a null model (holding D constant) and get a nice plot. However, now when I try and use this function with the D~session model or a model with a user defined habitat covariate, I get an error....

> rffxsurface <- fx.total(model=foxs_Dsession, sessnum=2, mask=sfoxs14)

Error in 1:nrow(sessmask) : argument of length 0

Do you have any suggestions on this error message? I am not totally clear on what it is trying to tell me, so my error mitigation attempts up to now have been unsuccessful. Thanks again
Casey

Murray Efford

unread,
Jun 24, 2015, 2:16:15 AM6/24/15
to Casey Pozzanghera, secr...@googlegroups.com
Probably you mean this --
rffxsurface <- fx.total(object=foxs_Dsession, sessnum=2, mask=sfoxs14)

I think it also expects 'mask' to be the mask for a single session, not a list of masks; I can't tell whether sfoxs14 meets this requirement.
Murray

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

cbpozz...@alaska.edu

unread,
Jun 24, 2015, 2:34:13 PM6/24/15
to secr...@googlegroups.com, cbpozz...@alaska.edu
HI Murray,

Sorry for the copy mistake with the code. In my actual model I did indeed run 
 
rffxsurface <- fx.total(object=foxs_Dsession, sessnum=2, mask=sfoxs14).

I have different masks for each of my 4 sessions, and "sfoxs14" in this case does represent the mask for my second session. So even when I specify the appropriate session mask, I am still getting the "Error in 1:nrow(sessmask):argument of length 0" error
Reply all
Reply to author
Forward
0 new messages