Skip to content

Commit

Permalink
Work about baitUse
Browse files Browse the repository at this point in the history
  • Loading branch information
damianooldoni committed Jun 12, 2023
1 parent 968b29d commit f6fa02f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions R/read_camtrap_dp.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,15 @@ read_camtrap_dp <- function(file = NULL,
dplyr::rename(cameraInterval = cameraDelay)
}
if ("baitUse" %in% names(deployments)) {
# transform Boolean to character and set FALSE to "none", TRUE to "other"
# baitUse values in version 0.1.6
bait_uses_old <- c("none", "scent", "food", "visual", "acoustic", "other")
# transform Boolean to character and set FALSE to "none", TRUE to "other".
# Do not change NAs
deployments <- deployments %>%
dplyr::mutate(baitUse = as.character(.data$baitUse)) %>%
dplyr::mutate(baitUse = dplyr::if_else(.data$baitUse == "FALSE",
true = "none",
false = "other"
"none",
"other"
)
)
# retrieve specific bait use info from tags if present
Expand Down

0 comments on commit f6fa02f

Please sign in to comment.