Skip to content

Commit

Permalink
Fix filtering with quoted variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Wright committed Jun 26, 2024
1 parent d0ceba3 commit 6bb2868
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/geography.R
Original file line number Diff line number Diff line change
Expand Up @@ -428,12 +428,12 @@ generate_ll_from_utm <- function(df,
dplyr::select(`_UTMJOINCOL`, {{EastingCol}}, {{NorthingCol}}, {{ZoneCol}}, {{DatumCol}})

withr::with_envvar(c("PROJ_LIB" = ""), { # This is a fix for the proj library bug in R (see pinned post "sf::st_read() of geojson not getting CRS" in IMData General Discussion).
# filter out rows that are missing UTM, zone, or datum
coord_df <- coord_df %>%
dplyr::filter(!is.na({{EastingCol}}) &
!is.na({{NorthingCol}}) &
!is.na({{ZoneCol}}) &
!is.na({{DatumCol}}))
coord_df <- coord_df %>%
dplyr::filter(!is.na(!!rlang::ensym(EastingCol)) &
!is.na(!!rlang::ensym(NorthingCol)) &
!is.na(!!rlang::ensym(ZoneCol)) &
!is.na(!!rlang::ensym(DatumCol)))


na_row_count <- nrow(df) - nrow(coord_df)
if (na_row_count > 0) {
Expand Down

0 comments on commit 6bb2868

Please sign in to comment.