Closed jniedballa closed 4 years ago
IMO the best approach would be the 1. with a stop()
call.
The error message would explain the issue and suggested call that users can run to solve it.
The suggested call would rely on a (new) camtrapR function implementing 2.
The new function would contain an argument for the time the user wants to make up with perhaps no default.
That way the user will clearly realize the possible consequences of her action.
Thank you. I started working on it already and the issue should be resolved with today's commit. I went with option 2, which should make the function more useful for anyone who doesn't have time of day information, with a clear warning about what the function does (assign occasionStartTime + 1 second). It doesn't really matter what time it assigns, since temporal resolution is 1 day maximum and it cannot spill over into the next day (occasionStartTime can only be 0...23). Also, this is done only if not a single record has time information. If after assinging the time there's still occasions 0, there's a stop() to catch it. So far it is a pretty rare scenario anyways.
e.g.
detectionHistory(..., recordDateTimeCol ="Date", recordDateTimeFormat = "dmy", day1 = "station" or "2015-12-01")
Seems to occur with output = "count" only.
When there is a record on the day the camera was set up and record times are dates without time, difftime between setup date and record date is 0. (detHist: # calculate the occasion each record belongs into from the time difference between records and beginning of the first occasion)
Then detHist: # fill detection matrix with 1 (or count) in appropriate cells can't access column 0, causing this error:
Possible solutions: