Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jennit07 <[email protected]>
  • Loading branch information
lizihao-anu and Jennit07 authored Oct 24, 2023
1 parent 35152a9 commit 7151cc4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions R/add_keep_population_flag.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ add_keep_population_flag <- function(individual_file, year) {
} else {
## Obtain the population estimates for Locality AgeGroup and Gender.
pop_estimates <-
readRDS(get_datazone_pop_path("DataZone2011_pop_est_2011_2021.rds")) %>%
dplyr::as_tibble() %>%
readr::read_rds(get_datazone_pop_path("DataZone2011_pop_est_2011_2021.rds"))

Check warning on line 18 in R/add_keep_population_flag.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_keep_population_flag.R,line=18,col=81,[line_length_linter] Lines should not be more than 80 characters.

Check warning on line 18 in R/add_keep_population_flag.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_keep_population_flag.R,line=18,col=83,[trailing_whitespace_linter] Trailing whitespace is superfluous.
dplyr::select(year, datazone2011, sex, age0:age90plus)

Check warning on line 19 in R/add_keep_population_flag.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_keep_population_flag.R,line=19,col=6,[indentation_linter] Indentation should be 4 spaces but is 6 spaces.

Check warning on line 19 in R/add_keep_population_flag.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_keep_population_flag.R,line=19,col=27,[object_usage_linter] no visible binding for global variable 'datazone2011'

Check warning on line 19 in R/add_keep_population_flag.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_keep_population_flag.R,line=19,col=41,[object_usage_linter] no visible binding for global variable 'sex'

Check warning on line 19 in R/add_keep_population_flag.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_keep_population_flag.R,line=19,col=46,[object_usage_linter] no visible binding for global variable 'age0'

Check warning on line 19 in R/add_keep_population_flag.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_keep_population_flag.R,line=19,col=51,[object_usage_linter] no visible binding for global variable 'age90plus'

# Step 1: Obtain the population estimates for Locality, AgeGroup, and Gender
Expand All @@ -31,10 +30,10 @@ add_keep_population_flag <- function(individual_file, year) {
} else {
previous_year <- sort(year_available, decreasing = TRUE)[1]
pop_estimates <- pop_estimates %>%
dplyr::filter(year = previous_year)
dplyr::filter(year == previous_year)
}

pop_estimates <- pop_estimates %>%
pop_estimates_filtered <- pop_estimates %>%

Check warning on line 36 in R/add_keep_population_flag.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_keep_population_flag.R,line=36,col=5,[object_usage_linter] local variable 'pop_estimates_filtered' assigned but may not be used
# Recode gender to make it match source.
dplyr::mutate(sex = dplyr::if_else(sex == "M", 1, 2)) %>%

Check warning on line 38 in R/add_keep_population_flag.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_keep_population_flag.R,line=38,col=42,[object_usage_linter] no visible binding for global variable 'sex'
dplyr::rename(
Expand Down

0 comments on commit 7151cc4

Please sign in to comment.