Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bw in th visits function #11

Open
KaraS106 opened this issue May 30, 2024 · 3 comments
Open

bw in th visits function #11

KaraS106 opened this issue May 30, 2024 · 3 comments

Comments

@KaraS106
Copy link

Hello- I am not having luck with the bw argument in the visits function. I want to change the interval to 21 seconds.

v1 <- visits(r2, bw = 21)

However I am still getting:

animal_id date start end logger_id animal_id logger_n
3B0018D434 | 2023-06-12 | 2023-06-12 16:02:20 | 2023-06-12 16:02:20 | 20222023DATAclean | 11929 | 1
3B0018D434 | 2023-06-12 | 2023-06-12 16:11:13 | 2023-06-12 16:11:13 | 20222023DATAclean | 11929 | 1
3B0018D434 | 2023-06-12 | 2023-06-12 16:11:30 | 2023-06-12 16:11:30 | 20222023DATAclean | 11929 | 1
3B0018D434 | 2023-06-12 | 2023-06-12 16:11:31 | 2023-06-12 16:11:33 | 20222023DATAclean | 11929 | 1
3B0018D434 | 2023-06-12 | 2023-06-12 16:13:13 | 2023-06-12 16:13:13 | 20222023DATAclean | 11929 | 1
3B0018D434 | 2023-06-12 | 2023-06-12 16:13:14 | 2023-06-12 16:13:14 | 20222023DATAclean | 11929 | 1
3B0018D434 | 2023-06-12 | 2023-06-12 16:13:51 | 2023-06-12 16:13:51 | 20222023DATAclean | 11929 | 1
3B0018D434 | 2023-06-12 | 2023-06-12 16:13:52 | 2023-06-12 16:13:52 | 20222023DATAclean | 11929 | 1
3B0018D434 | 2023-06-12 | 2023-06-12 16:13:53 | 2023-06-12 16:13:53 | 20222023DATAclean | 11929 |  1

which looks to me like it is still logging "separate visits" every second.

Any insight would be appreciated!

@steffilazerte
Copy link
Member

Hi @KaraS106, that is odd. Do you have the same problem if you try the examples in visits() (i.e. visits(finches))?

If not then there may be something specific to your data that is causing the problem. Without a more detailed look it'll be hard to tell.

Would you be able to share a small version of r2 with me? You can save it with writeRDS(r2, "my_data.rds") and email it to [email protected].

@steffilazerte
Copy link
Member

Hi @KaraS106,

Thanks for sharing your data with me. Looking at your data I can see that this isn't in fact a problem, but a good thing! visits() uses a couple of things to assess whether a new visit has started, 1) how long between reads, 2) whether another animal_id was detected at the same logger, or whether an animal went to a different logger (if you type ?visits in the console, you'll see some more details about this in the help file).

In this case, if you look at your raw data over this time frame, there are several individuals at the logger. Visits by 3B0018D434 won't be collapsed into a single visit (16:11:30 - 16:11:33) because there is evidence that another individual was detected by the logger in the middle of that visit (3B0018321E).

  animal_id       date                time         logger_id
 3B0018D434 2023-06-12 2023-06-12 16:11:30 20222023DATAclean
 3B0018321E 2023-06-12 2023-06-12 16:11:31 20222023DATAclean ***
 3B0018321E 2023-06-12 2023-06-12 16:11:31 20222023DATAclean ***
 3B0018321E 2023-06-12 2023-06-12 16:11:31 20222023DATAclean ***
 3B0018321E 2023-06-12 2023-06-12 16:11:31 20222023DATAclean ***
 3B0018D434 2023-06-12 2023-06-12 16:11:31 20222023DATAclean
 3B0018D434 2023-06-12 2023-06-12 16:11:31 20222023DATAclean
 3B0018D434 2023-06-12 2023-06-12 16:11:31 20222023DATAclean
 3B0018D434 2023-06-12 2023-06-12 16:11:31 20222023DATAclean
 3B0018D434 2023-06-12 2023-06-12 16:11:32 20222023DATAclean
 3B0018D434 2023-06-12 2023-06-12 16:11:32 20222023DATAclean
 3B0018D434 2023-06-12 2023-06-12 16:11:32 20222023DATAclean
 3B0018D434 2023-06-12 2023-06-12 16:11:32 20222023DATAclean
 3B0018D434 2023-06-12 2023-06-12 16:11:33 20222023DATAclean

That's why you got two visits for that individual (above)
3B0018D434 | 2023-06-12 | 2023-06-12 16:11:30 | 2023-06-12 16:11:30 | 20222023DATAclean | 11929 | 1
3B0018D434 | 2023-06-12 | 2023-06-12 16:11:31 | 2023-06-12 16:11:33 | 20222023DATAclean | 11929 | 1

You can use the presence() function to get a measure of overall presence around a logger without worrying about the other individuals.

I know the feedr package is a bit clunky right now and the documentation unfortunately references some out-of-date techniques. I'd love to spend some time on getting it a bit nicer, but I haven't had the opportunity!

Good luck 😁

@KaraS106
Copy link
Author

KaraS106 commented May 31, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants