eldarrak / FLightR

R package to position animals with solar geolocation archival tags
Other
21 stars 10 forks source link

Cutoff probability value leading to an error #23

Closed Gasparticho closed 2 years ago

Gasparticho commented 2 years ago

Hello eldarrak,

I am writing to you about some error I am facing using FLightR 0.5.1. I have got some troubles running the stationary.migration.summary() function with some prob.cutoff values.

In my particular example, I have no problem running the above mentioned function with prob.cutoff values of 0.2 and 0.4 but the function raises an error when running with a prob.cutoff of 0.3. I imagine how the function might not work with some cutoff probability values but the fact that higher and lower values work questions me.

More precisely, I get the error "$ operator is invalid for atomic vectors" when running the function with 0.3. This error seems to come from the get_time_boundaries() function. By looking a little bit more into the code details, it seems that this error comes from the fact that the Schedule object created in get_time_boundaries() function (as the result of find.times.distribution()) is at some point NA.

Do you have any idea why does this error happen? Could this be something problematic?

I know the prob.cutoff values I am discussing are probably very high but they do not lead to a "bird likely did not move" scenario (and are not the ones I will be using in the end for my analyses).

Could I send you the result object I am currently working on so you could replicate my error (if you want/need to).

Thank you in advance for your answer, Best regards,

Gaspard Baudrin

eldarrak commented 2 years ago

Hi Gaspard, Thank you for reporting this weird behaviour! I would appreciate if you send me an example. Best, Eldar

Gasparticho commented 2 years ago

Hi Eldar,

Thank you very much for your answer. I have sent you the example on your University of Amsterdam email address if this is fine for you.

Best, Gaspard

eldarrak commented 2 years ago

Thanks Gaspard, I will have a look next week - remind me if you will not hear from me, please.

Gasparticho commented 2 years ago

Hi Eldar,

Thanks again for considering my issue. As you told me, here is a litlle reminder :)

Best, Gaspard

eldarrak commented 2 years ago

Hi Gaspard, That was a significant bug in the code, that I have corrected now. Hope all works now and thank you for discovering it!

Gasparticho commented 2 years ago

Hi Eldar,

Thank you very much for your answer ! I will try it soon.

Best, Gaspard