date format for Problem1_from and _to

21 views
Skip to first unread message

davidgeorg...@gmail.com

unread,
Sep 6, 2020, 7:41:56 PM9/6/20
to camtrapR
Juergen

In the Stations data frame Setup_date and Retrieval_date will accept a variety of date formats. These attributes work with other functions. The same does not seem to be true for the Problem1_from and Problem1_to.  These must plain character dates?

If so, that seems (slightly) inconsistent?

David

Juergen Niedballa

unread,
Sep 7, 2020, 8:12:05 AM9/7/20
to camtrapR
Hi David,
a fix is implemented in the development version already, but not released yet. So for time being, please convert the Problem columns to character before using cameraOperation(). The easiest way would be to run as.character(). Or use the code snippet below, which is straight from the function and converts all problem columns to character.

 # find problem columns
    cols.prob.from <- grep(colnames(CTtable), pattern = "Problem\\d\\Sfrom")
    cols.prob.to   <- grep(colnames(CTtable), pattern = "Problem\\d\\Sto")
    
    # convert problem columns to character
    for(problem_col_index in c(cols.prob.from, cols.prob.to)){
      CTtable[, problem_col_index] <- as.character(CTtable[, problem_col_index])
    }

In the next release it will be done automatically inside the function. Currently, it is work in progress as I'm changing a few more things in cameraOperation(). I'll notify you here in the group when the new version is released.
Thank you for your patience.
Best regards,
Jürgen 

Reply all
Reply to author
Forward
0 new messages