Skip to content

Commit a2f14a9

Browse files
committed
Fix some minor issues
1 parent b19deea commit a2f14a9

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

R/get_pop_est.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#'
4242
#' # Age Groups with Custom Settings:
4343
#' # Aggregate into 5-year age groups, with an open-ended final group "85+"
44-
#' get_pop_est("hb", age_groups = TRUE, by = 5, to = "85+")
44+
#' get_pop_est("hb", age_groups = TRUE, by = 5, to = 85)
4545
#'
4646
#' # Pivot Wider (All): CA Population Estimates, Reshaped by Sex and Age Group
4747
#' # The result will have columns for each combination of sex and age group,
@@ -100,7 +100,7 @@ get_pop_est <- function(
100100
{.file {fs::path_file(pop_path)}} file."
101101
)
102102
}
103-
pop_est <- pop_est[pop_est$year >= min_year, ]
103+
pop_est <- dplyr::filter(pop_est, .data$year >= min_year)
104104
}
105105

106106
if (!is.null(max_year)) {
@@ -111,18 +111,18 @@ get_pop_est <- function(
111111
{.file {fs::path_file(pop_path)}} file."
112112
)
113113
}
114-
pop_est <- pop_est[pop_est$year <= max_year, ]
114+
pop_est <- dplyr::filter(pop_est, .data$year <= max_year)
115115
}
116116

117117
# Create age groups
118118
if (age_groups) {
119119
pop_est <- pop_est |>
120120
dplyr::mutate(
121-
age_group = phsmethods::create_age_groups(x = age, ...),
121+
age_group = phsmethods::create_age_groups(x = .data$age, ...),
122122
.keep = "unused"
123123
) |>
124-
dplyr::group_by(dplyr::across(!pop)) |>
125-
dplyr::summarise(pop = sum(pop), .groups = "drop")
124+
dplyr::group_by(dplyr::across(!.data$pop)) |>
125+
dplyr::summarise(pop = sum(.data$pop), .groups = "drop")
126126
}
127127

128128
# Pivot data

man/get_pop_est.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)