Camera operation matrix for multi-season

53 views
Skip to first unread message

Vishnu r menon

unread,
Oct 11, 2020, 10:23:51 PM10/11/20
to camtrapR
Hi everyone,

I want to run a single species multi-season model, and I am trying to setup my camera operation matrix. I have a data frame with my station and camera info:

1.JPG
2.JPG

There are two sessions (1 is for prefire and 2 for postfire). But when I try to obtain the camera operation matrix with the following code, all values for my session 2 comes as NA. The values comes up fine if I am running the codes for different seasons/sessions separately.

camop_noproblem_ASC2019 <- cameraOperation(CTtable      = camop_ASC2019,
                                              stationCol   = "station",
                                              cameraCol    = "camera",
                                           sessionCol = "session",
                                             byCamera     = F,
                                              allCamsOn    = T,
                                              setupCol     = "installed",
                                              retrievalCol = "removed",
                                              dateFormat   = "%Y - %m - %d"  )

I am unable to figure out what the error is. Below is the output image
3.JPG

Any help would be appreciated, thanks a lot!

Warm regards,
Vishnu

Juergen Niedballa

unread,
Oct 12, 2020, 5:45:51 AM10/12/20
to camtrapR
Hi Vishnu,
the date format differs between session 1 and 2. In session 1, "installed" and "removed" columns are dates, in session 2 they are date-times. 
You then specify  dateFormat   = "%Y - %m - %d" , so session 2 would not be recognised. The ususal warnings / error messages don't catch this because it is correct for session 1. On a side note, I'd remove the spaces from the dateFormat argument, I'm surprised it works at all. Or use the lubridate specification: dateFormat = "ymd"
Also, the next release of camtrapR will support date-times for setup / retrieval / problem columns, but the current version on CRAN does not yet. 
Best regards,
Jürgen

Vishnu r menon

unread,
Oct 13, 2020, 1:04:21 AM10/13/20
to camtrapR
Hi Juergen,

Thanks a lot for the reply. I changed the date formats for both sessions using lubridate as said.

1.JPG
But I still seem to run into the same error when I run the cameraoperation code.

camop_noproblem_ASC2019 <- cameraOperation(CTtable      = camop_ASC2019,
                                              stationCol   = "station",
                                              cameraCol    = "camera",
                                           sessionCol = "session",
                                             byCamera     = F,
                                              allCamsOn    = T,
                                              setupCol     = "installed",
                                              retrievalCol = "removed",
                                              dateFormat   = "%Y-%m-%d"  
                                           )

2.JPG

The session dates are different as they were carried out at different months, but this will not affect the output right? Thanks again!

Regards,
Vishnu

Vishnu r menon

unread,
Oct 13, 2020, 8:29:06 PM10/13/20
to camtrapR
Sorry, my bad, its working properly now! Thanks for the help!
Reply all
Reply to author
Forward
0 new messages