Skip to content

Commit

Permalink
Set patch for speed-radius-angle in version related if()
Browse files Browse the repository at this point in the history
  • Loading branch information
damianooldoni committed Jun 27, 2023
1 parent 85fd69f commit 6aabe92
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions R/read_camtrap_dp.R
Original file line number Diff line number Diff line change
Expand Up @@ -328,18 +328,19 @@ read_camtrap_dp <- function(file = NULL,
}
}

## IS THIS STILL NEEDED????
# patch for non-standard values speed, radius, angle
# see https://github.com/inbo/camtraptor/issues/185
obs_col_names <- names(observations)
if (all(c("X22", "X23", "X24") %in% names(observations))) {
observations <- observations %>%
dplyr::rename(speed = "X22", radius = "X23", angle = "X24")
message(
paste("Three extra fields in `observations` interpreted as `speed`,",
"`radius` and `angle`."
if (version == "0.1.6"){
# patch for non-standard values speed, radius, angle
# see https://github.com/inbo/camtraptor/issues/185
obs_col_names <- names(observations)
if (all(c("X22", "X23", "X24") %in% names(observations))) {
observations <- observations %>%
dplyr::rename(speed = "X22", radius = "X23", angle = "X24")
message(
paste("Three extra fields in `observations` interpreted as `speed`,",
"`radius` and `angle`."
)
)
)
}
}

# create first version datapackage with resources in data element
Expand Down

0 comments on commit 6aabe92

Please sign in to comment.