-
Notifications
You must be signed in to change notification settings - Fork 4
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
Residency Index Constraints #129
Comments
In GitLab by @jdpye on Jan 25, 2021, 24:23 assigned to @ryangosse |
In GitLab by @jdpye on Jan 25, 2021, 24:30 I've been thinking about how to generalize this use case, to keep the function from having to take on many more assumptions, and I'm currently thinking I'd prefer seeing a user-defined subsetting strategy (i.e. using a groupby and group_walk calling the RI function) rather than handling the group/splitting logic inside the function. Definitely could use a flag that preserves the 0 values in the return from RI (and maybe any other possibly interesting column values that could survive the RI groupings), that shouldn't be too heavy a lift here, and i think we can design a good workflow example once we have that. Expanding/fixing the doc is important too! no surprises for the users that way. |
In GitLab by @chrisholbrook on Jan 25, 2021, 08:16 I agree on both suggestions; current requirement of compressed detection_events input object could be relaxed. Perhaps treat existing function as a wrapper for exported lower-level residence_index that assumes input is a single group. The wrapper (existing residence_index) should easily be expanded to recognize uncompressed detection events and compress if needed. |
In GitLab by @benjaminhlina on Feb 4, 2021, 15:59 Currently, due to this constraint it is easier to use |
In GitLab by @chrisholbrook on Feb 4, 2021, 18:08 @benjaminhlina A value RI = 0 would result if a fish was never detected at a location, so I would interpret this as complete absence. It is possible that some of the methods would return a value zero if all visits to a site were masked by longer visits to another site during the same time interval (e.g., if binning by day and only using the most prominent site on that day). The main limitation with calling the current glatos::residence_index from a dplyr::group_by is that residence_index does not include the grouping column in the return object, so some extra handling is required. If you are doing this and have some example code to share, a snippet would be appreciated. I like the idea of adding flexibility to do both: carry through any grouping variables from group_by method and allow grouping within residence_index on variables other than location (including multiple variables/columns). |
In GitLab by @benjaminhlina on Feb 4, 2021, 21:33 @chrisholbrook okay, that makes sense so it be becomes a absence value similar to if I was solely looking at presence absence of a fish. The method you describe makes sense as well. As far as the using |
In GitLab by @jdpye on Feb 4, 2021, 21:49 A snippet might be the right way to do it: https://gitlab.oceantrack.org/-/snippets/new |
In GitLab by @benjaminhlina on Feb 4, 2021, 22:00 @jdpye I like the idea but the link you you shared comes up with a 404 error. I did find the gitlab's info on snippets but I'm not sure if I have the right permissions to create one as I can't seem to find make a new snippet. |
In GitLab by @chrisholbrook on Feb 5, 2021, 09:24 @benjaminhlina I am not familiar with snippets but will defer to @jdpye preference on this and for guidance to make it work. Whether a snippet or reprex, I do like the idea of posting your sample code here if it is related to the OP. |
In GitLab by @jdpye on Feb 5, 2021, 09:38 Didn't realize i'd restricted snippet-making, i'll try and fix that for you, i find they're second best to a pull request. Definitely good for posting a link in tickets. |
In GitLab by @benjaminhlina on Feb 5, 2021, 09:40 @jdpye Awesome, I'll wait for you to try to give me access. If not no worries and I'll post the reprex. |
In GitLab by @jdpye on Feb 5, 2021, 09:49 There we go, should work now. We disabled snippets for External users since it was a huge spam vector for bots advertising gambling sites. Switched you to Internal. |
In GitLab by @benjaminhlina on Feb 5, 2021, 11:16 @jdpye thanks for giving me permission. I've created snippet 231. Hope this helps and works for sharing the method I currently use. |
In GitLab by @benjaminhlina on Mar 18, 2021, 18:57 I have added an amended comment to snippet 231 which uses the function |
In GitLab by @morganpiczak on Jan 23, 2021, 18:07
Trying to calculate residency index per season (across 10 years of data and 40 seasons).
When using detection_events, if you choose False (to carry over extra data such as seasons), it does not produce the columns needed for residency index (i. e. first detection and last detection). So it would be good to be able to keep desired columns, while also having the required columns for residency index.
Additionally, currently as it is written, the vignette only states that animal_id, detection_timestamp, mean_lat and mean_long are required, which I think is incorrect (as it needs first and last detection from detection events).
It would be extremely helpful to be able to have residency calculated by a specified parameter (from a carried over column from detection events) such as season, species or year. As the function currently stands, it calculates residency index for all stations with detections, but does not carry forward the stations with no detections (which would be essential for a habitat selection analysis for example).
The text was updated successfully, but these errors were encountered: