hasProblems = TRUE issues

46 views
Skip to first unread message

Courtney Burk

unread,
Jun 9, 2024, 2:03:56 AM6/9/24
to camtrapR
Hi all,

I keep getting this error and can't figure out how to fix it: 
> CamOp <- cameraOperation(CTtable, + stationCol = "Site.ID", + sessionCol = "Session", + setupCol = "SetupDate", + retrievalCol = "TakedownDate", + hasProblems = TRUE, + dateFormat = "%m/%d/%Y", + ) Error in if (all(inputColumn == "") & allowEmptyOutput) return(NA) : missing value where TRUE/FALSE needed

Any insight would be much appreciated. Based on the source code, everything seems like it's written correctly. TIA!

Jarrad Barnes

unread,
Jul 3, 2024, 4:15:46 PM7/3/24
to camtrapR
For this to run, CTtable needs to point to a dataframe e.g. CTtable = dat (unless you've specified it previously before running the code). Even with that fixed, I don't see how this runs at all with the "+" symbol before each line of code. Does specifying the CTtable and removing the "+"s make this work?

Jürgen Niedballa

unread,
Jul 17, 2024, 12:45:13 AM7/17/24
to Jarrad Barnes, camtrapR
Hello,
and sorry for the late reply, missed the original post. 
As said, CTtable needs to be specified, unless you have an object of that name in your environment. 
The + are likely only from copying code from the console, but should not appear in actual code.
There is also a comma at the end which implies an empty/ unassigned function argument after and may cause problems, so I'd suggest removing it. 
If none of this helps please share a small data subset, ideally in a saved R workspace. The error suggests some . unforeseen condition which is not caught by a proper error message.

Thank you 


--
You received this message because you are subscribed to the Google Groups "camtrapR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camtrapr+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/camtrapr/39a9a643-601e-4d0b-9847-d8b40d6f7dcen%40googlegroups.com.

Sean Sultaire

unread,
Jul 30, 2024, 12:51:05 PM7/30/24
to camtrapR
I'm having the same issue running cameraOperation on a CTtable with hasProblems=TRUE in the newest camtrapR version. Below is my code and attached is my CTtable. I'm fairly certain there isn't anything weird with the problem columns (e.g., Problem_from>Problem_to). I've tried running the code on a table I read in with and without NA's in the Problem columns. 

Any help is much appreciated

cam_op <- cameraOperation(CTtable = CTtable,
                          stationCol = "Station",
                          setupCol = "setup",
                          retrievalCol = "retrieval",
                          hasProblems = TRUE,
                          camerasIndependent = TRUE,
                          dateFormat = '%m/%d/%Y',
                          writecsv = FALSE)
CTtable_Oct2020-June2023.csv

Sean Sultaire

unread,
Aug 10, 2024, 10:02:06 PM8/10/24
to camtrapR
I was able to figure this out. Turns out my Problem3_from and Problem3_to columns were empty.

Jürgen Niedballa

unread,
Aug 11, 2024, 5:24:00 AM8/11/24
to Sean Sultaire, camtrapR
Thank you for the update. I will add a check and informative error massage for this situation to the function.

Reply all
Reply to author
Forward
0 new messages