Skip to content

Commit 98656a9

Browse files
committed
switched to use .data to avoid note about global variables
1 parent ea2fc68 commit 98656a9

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

R/sf_to_grid.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ sf_to_grid <- function(dat, spatial_grid, matching_crs, name, feature_names, ant
9191
dplyr::mutate(area = as.numeric(sf::st_area(.))) %>%
9292
sf::st_drop_geometry(.) %>%
9393
dplyr::full_join(spatial_grid_with_area, ., by = c("cellID")) %>%
94-
dplyr::mutate(perc_area = area / area_cell, .keep = "unused", .before = 1) %>%
95-
dplyr::mutate(perc_area = dplyr::case_when(is.na(perc_area) ~ 0,
96-
.default = as.numeric(perc_area))) %>%
94+
dplyr::mutate(perc_area = .data$area / .data$area_cell, .keep = "unused", .before = 1) %>%
95+
dplyr::mutate(perc_area = dplyr::case_when(is.na(.data$perc_area) ~ 0,
96+
.default = as.numeric(.data$perc_area))) %>%
9797
dplyr::left_join(spatial_grid_with_id, ., by = "cellID") %>%
98-
dplyr::select(!cellID) %>%
98+
dplyr::select(!.data$cellID) %>%
9999
{if(!apply_cutoff) dplyr::select(., 1, {{x}} := 1) else {
100100
dplyr::mutate(.,
101-
{{x}} := dplyr::case_when(perc_area >= cutoff ~ 1,
101+
{{x}} := dplyr::case_when(.data$perc_area >= cutoff ~ 1,
102102
.default = 0)
103103
) %>%
104104
dplyr::select({{x}})

man/get_data_in_grid.Rd

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)