JohannaMz / ClusterApp

GNU General Public License v3.0
2 stars 0 forks source link

Bugs and parameter addition #3

Open zwardle opened 1 month ago

zwardle commented 1 month ago

Great application -- thanks for developing! In starting to use it, I noticed a couple of potential bugs:

1. Crashes when 0 clusters are found per the selected parameters. This occurs when the analysis is on a single individual that has 0 clusters, and when the analysis is on multiple individuals and at least one individual has 0 clusters. The application crashes/closes, and this message appears in RStudio:

Warning: Error in stopifnot: ℹ In argument: ts >= Clusters_sf$date_min[j] & ts <= Clusters_sf$date_max[j].

Caused by error: ! ..1 must be of size 20 or 1, not size 0.

2. Crashes when UTM zone 17 is selected. The application crashes/closes when 17 is selected (but not 1, for example), and this message appears in RStudio:

Warning: Error in : crs not found: is it missing?

Also, is is possible for another optional parameter to be added to the cluster analysis? Current parameters include:

But it’s possible to inadvertently inflate clusters by grouping GPS data that were collected far apart in time (the opposite issue of what the existing “minimum time between” parameter aims to prevent). Selecting the “Should only GPS location clusters with consecutive GPS locations be developed?” option prevents this in some cases but not others, like if time elapsed is more important to the user than consecutiveness. For example: Four locations are needed for a cluster. Three consecutive locations are found in one small area, almost meeting the user’s definition of a cluster. The next consecutive location is outside the polygon of the developing cluster, but the following location is back in the polygon (animal left but returned to the same spot). Per the user's question, they'd want a cluster to develop. Unless I'm overlooking something, I don't see a way to configure parameters for that type of scenario.

Would a new parameter such as "Set the maximum time between any given GPS location and subsequent GPS locations" or maybe "Set the maximum time between a cluster's first (or latest) GPS location and subsequent GPS locations" help with that?

JohannaMz commented 1 month ago

Thanks a lot for your feedback, those are very good points! I will work on the bugs and make a new version available as soon as possible. Regarding the new parameter, that you are suggesting. You are right that this doesn't exist yet and we will consider, how we can add this option to the application. When using all GPS locations for the analysis, the value of "Percent of time spent at the location" does, however, give an estimation in which time frame the animal used the cluster. If the animal only left the cluster for a short excursion and then returned, that value would be close to 1. The value would be close to 0, if the cluster developed over a long time period, so an area where the animal only returns to sporadically. This does, of course, require that there are enough GPS locations within the area that a cluster can develop. I hope this helps and thanks again for your feedback.