mercredi 23 janvier 2019

Using if-else statements in R to create "quiet period"

I have some data from camera traps and I am trying to create trigger histories (a chart with each species trigger at each camera) for each year that I have data. These tables include a 30min quiet period. That is to say that any species captured multiple times in front of the same camera within 30min is only counted once so that we are not counting the same individual multiple times. For a couple of the years I used the recordTable function in camtrapR, which worked well because the photos were separated into folders by the species names. For another year I only have the data on a spreadsheet, it is not separated into folders. I have found that recordTable only works when reading files and cannot be applied to create the table I need from the table I have. For this final year of data I think that I should be able to use an if-else statement to take out any photos that were taken within 30min of the last photo, but I am not exactly sure what that would look like.

if the photo was taken within 30min of the last photo 

of this species at this camera, then it needs to be take out. Otherwise, it can stay in.

This is the only piece of the table I am missing. All the other information that I need can be pulled from the first table.

Aucun commentaire:

Enregistrer un commentaire