non-numeric argument to binary operator

98 views
Skip to first unread message

1234 adsf

unread,
Jan 29, 2024, 4:17:22 PM1/29/24
to ctmm R user group
Dear Christen,

First of all, thank you for your work to make the ctmm package available.
I am writing to ask your help regarding an error that I ran into while analyzing our GPS tracing data. Normally it works without problems for several individuals of animals, but for one of them I ran into the below error:

ctmm_speed <- speed(telemetry_akde,FIT1_pHREML)
Error in sqrt(diff(data$x)^2 + diff(data$y)^2)/DT/SPD non-numeric argument to binary operator

The data that causes the error was collected with the same method as all the rest that work well with the calculations. For troubleshooting, I have tried two things:

I tried to find the part of code that gives the eror. It might be speed.r line 249 (FRAC <- sqrt(diff(data$x)^2+diff(data$y)^2)/DT / SPD), but it was too complicated for me to track down if it really is, and how exactly the problem occurs.
Another thing I tried was to narrow down the input data to identify the problematic content in it. This attempt was also not successful, as I got a differen error when I eliminated the first half of my data and ran the script. (I saw the progress bar was at 53% when the error happened, so I assumed it might have to do with some data quality issue at about the 53% section of my data.) Whe I did this, I got the "Movement model is fractal" error.

What could be the best troubleshooting steps to solve this?
Thank you!

Máté Pölös

Christen Fleming

unread,
Jan 31, 2024, 10:20:50 AM1/31/24
to ctmm R user group
Hi Máté,

Can you send me a minimal working example (data + script) to reproduce the error?

"Movement model is fractal" isn't an error by itself, but a warning that the data are too coarse to estimate speed.

Best,
Chris

Matt

unread,
Aug 21, 2024, 3:33:34 PM8/21/24
to ctmm R user group
Hey Chris and Máté,

Just wanted to follow up on this and see if either of you had any thoughts. I'm getting the same error while estimating speed.

Thanks,
Matt
Message has been deleted

Margaret Mercer

unread,
Aug 28, 2024, 1:20:13 PM8/28/24
to ctmm R user group
Hi Chris,

I'm also experiencing the same issue when running the "speed" function. I'll send you a minimal working example.

Thanks,
Margaret

Christen Fleming

unread,
Sep 2, 2024, 10:20:58 PM9/2/24
to ctmm R user group
Thanks Margaret,

I pushed a fix GitHub. Also, with a movement model that tortuous, I would also set robust=TRUE in all of the speed() calculations.

Best,
Chris

Margaret Mercer

unread,
Sep 26, 2024, 6:07:53 PM9/26/24
to ctmm R user group
Hi Chris, 

Thank you! It's taken a while but I finally got the speed() function to work, although I'm getting Inf for many of my individuals. I'll troubleshoot it myself and reach out again if the problem persists.

Reply all
Reply to author
Forward
0 new messages