Error message in rsf.fit : missing value where TRUE/FALSE needed

158 views
Skip to first unread message

Megan McDaniels

unread,
Aug 10, 2023, 11:22:44 AM8/10/23
to ctmm R user group
Hi Chris,

I have been trying to use the rsf.fit function for American kestrel GPS data, and have received an error producing the message: "missing value where TRUE/FALSE needed". I am following the rsf.fit vignette in ctmm learn using my data. 

I was able to run the "TEST" line with the simplified rsf.fit without error:

TEST <- rsf.fit(cliftonKestrelTel[[i]],cliftonAKDES[[i]],R=list(habitat=cliftonEnvData))

However, when I ran the chunk below with the Riemann integrator I was receiving the following message:

RSF <- list()

for(i in 1:length(cliftonKestrelTel))

{

  RSF[[i]] <- rsf.fit(cliftonKestrelTel[[i]],cliftonAKDES[[i]],R=list(habitat=cliftonEnvData),integrator="Riemann",trace=2)

}


"Error in if (max(abs(c(diff(dX)/mid(dX), diff(dY)/mid(dY), diff(Xo)/mid(Xo), : missing value where TRUE/FALSE needed."

After reading other conversations in this group about similar errors, I updated ctmm through Github using devtools::install_github("ctmm-initiative/ctmm", force=TRUE, lib='myFolder'). After this, I am still receiving the same error message when using rsf.fit with the Riemann integrator. Do you know if this may be an issue on my end, or a bug within rsf.fit?

Thank you in advance for your time!

Best,
Megan

Christen Fleming

unread,
Aug 10, 2023, 11:35:35 AM8/10/23
to ctmm R user group
Hi Megan,

I haven't seen that error. If you could please send me a dropbox link to the 3 object, I can take a look.

Best,
Chris

Megan McDaniels

unread,
Aug 11, 2023, 10:57:07 AM8/11/23
to ctmm R user group
Thanks so much, Chris! I emailed you separately with the link to these data.

Best,
Megan

Reply all
Reply to author
Forward
0 new messages