MarcusRowcliffe / camtrapDensity

1 stars 0 forks source link

correct_time() not working as expected #2

Closed bramdhondt closed 1 year ago

bramdhondt commented 1 year ago

I greatly welcome the function correct_time(), as this helps avoid cumbersome scripting in the not-so-rare case of wrong time settings of cameras.

When applying the logic of the example to my dataset, the function doesn't fully correspond to my expectations, however. To illustrate, I start with the following list of deployments (trimmed list).

afbeelding

As you can see, the last deployment is an oddball: it was not installed, nor read out, that late in the evening. The time settings of the camera are simply wrong.

Applying the following code...

sub <- correct_time(sub,
                   deploymentID = "c8008e80-3684-4ee0-a491-0e11a7d55918",
                   wrongTime = "2023-01-12 23:07:50",
                   rightTime = "2023-01-13 12:00:00")

... leads to the following result.

afbeelding

The requested time span was successfully added to both the end and start time of the respective deployment. But contrary to expectations, the same time span was added to all deployments. I assume this was not intended. I also don't find a solution in the function's documentation.

Apart from this, I congratulate you with this great package. At INBO, the REM functions of the package are now in use for estimating the abundance of a local muntjac population - a species of great policy concern to us.

MarcusRowcliffe commented 1 year ago

@bramdhondt many thanks for raising this and your clear explanation. There was indeed a foolish mistake, now fixed I believe. Let me know if not.