Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

934 review tests on createslf package #942

Merged
merged 16 commits into from
Apr 15, 2024
2 changes: 1 addition & 1 deletion .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ McMahon
Moohan
Scougal
Tayside
Zihao
Zihao
28 changes: 13 additions & 15 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ atlassian
attendcat
aut
bedday
beddays
birthtime
bodyloc
boxi
Expand Down Expand Up @@ -61,16 +60,16 @@ dischto
disdest
dminutes
dna
dnas
dontrun
downup
dplyr
dsn
dtplyr
DVPROD
dvprod
envir
fcase
feb
fifelse
fileext
Finalise
fst
Expand All @@ -80,31 +79,32 @@ fyyear
geogs
ggplot
github
GLS
gls
gms
GPOo
gpprac
gss
hbnames
hbp
hbpraccode
hbrescode
hbtreatcode
hbtreatname
hci
HCP
HHG
hhg
hjust
hms
homecare
homev
hri
hscdiip
hscp
hscpnames
htmlwidgets
IDPC
infyyear
intzone
ipdc
issuenumber
itle
Expand All @@ -119,19 +119,20 @@ keytime
keytimex
kis
lazydt
lcap
LCHO
lgl
lintr
los
ltc
ltcs
lubridate
magrittr
markdownguide
Matern
Mcbride
mcmahon
MMMYY
monthflag
MONTHFLAG
mpat
multiday
multisession
Expand All @@ -140,7 +141,6 @@ NAs
newcons
nhs
nhshosp
NRS
nrs
nsu
odbc
Expand All @@ -161,9 +161,9 @@ pkgdown
placeinc
plics
PMS
popluation
postcodes
PPAs
Prac
prac
praccode
ptypes
Expand All @@ -172,7 +172,7 @@ quickstart
rankdir
Rbuildignore
rcmdcheck
rdd
RDD
rds
reabl
reablement
Expand All @@ -190,29 +190,28 @@ roxygen
Rprofile
Rscript
rspm
RStudio
rstudio
rstudioapi
Rtype
scoial
scotp
SDcols
seealso
selfharm
setkeyv
setnafill
setnames
setorder
Siar
sigfac
simd
SLF
slf
slfhelper
smr
SMRA
smrtype
SPARRA
sparra
spd
SPSS
spss
stadm
starwars
Expand All @@ -223,7 +222,6 @@ submis
tadm
tarchetypes
tbl
Telecare
telecare
testthat
thom
Expand Down
51 changes: 26 additions & 25 deletions R/add_hri_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#' \itemize{
#' \item{keep_flag = 0 when resident is Scottish}
#' \item{keep_flag = 1 when resident is not Scottish}
#' \item{keep_flag = 2 when the postcode is missing or a dummy, and the gpprac is missing}

Check warning on line 7 in R/add_hri_variables.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_hri_variables.R,line=7,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 90 characters.
#' \item{keep_flag = 3 when the gpprac is not English and the postcode is missing}

Check warning on line 8 in R/add_hri_variables.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_hri_variables.R,line=8,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 82 characters.
#' \item{keep_flag = 4 when the gpprac is not English and the postcode is a dummy}

Check warning on line 9 in R/add_hri_variables.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_hri_variables.R,line=9,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 82 characters.
#' }
#' The intention is to only keep the records where keep_flag = 0
#'
Expand All @@ -22,23 +22,23 @@
# of the postcode
pc_areas <- slf_pc_lookup %>%
dplyr::mutate(
pc_area = stringr::str_match(postcode, "^[A-Z]{1,3}"),
pc_area = stringr::str_match(.data$postcode, "^[A-Z]{1,3}"),

Check warning on line 25 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L25

Added line #L25 was not covered by tests
scot_flag = TRUE
) %>%
dplyr::distinct(pc_area, scot_flag)
dplyr::distinct(.data$pc_area, .data$scot_flag)

Check warning on line 28 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L28

Added line #L28 was not covered by tests

# Create a flag, 'keep_flag', to determine whether individuals are Scottish
# residents or not
return_data <- data %>%
dplyr::mutate(pc_area = stringr::str_match(postcode, "^[A-Z]{1,3}")) %>%
dplyr::mutate(pc_area = stringr::str_match(.data$postcode, "^[A-Z]{1,3}")) %>%

Check warning on line 33 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L33

Added line #L33 was not covered by tests

Check warning on line 33 in R/add_hri_variables.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_hri_variables.R,line=33,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 82 characters.
dplyr::left_join(pc_areas, by = "pc_area") %>%
dplyr::mutate(
dummy_postcode = .data$postcode %in% c("BF010AA", "NF1 1AB", "NK010AA") |
stringr::str_sub(.data$postcode, 1, 4) %in% c("ZZ01", "ZZ61"),
eng_prac = .data$gpprac %in% c(99942, 99957, 99961, 99976, 99981, 99995, 99999),

Check warning on line 38 in R/add_hri_variables.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_hri_variables.R,line=38,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 86 characters.
scottish_resident = dplyr::case_when(
.data$scot_flag ~ 0L,
(is_missing(.data$postcode) | .data$dummy_postcode) & is.na(.data$gpprac) ~ 2L,

Check warning on line 41 in R/add_hri_variables.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/add_hri_variables.R,line=41,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 87 characters.
!.data$eng_prac & is_missing(.data$postcode) ~ 3L,
!.data$eng_prac & .data$dummy_postcode ~ 4L,
.default = 1L
Expand All @@ -58,6 +58,7 @@
#' @param data An SLF individual file.
#' @param slf_pc_lookup The Source postcode lookup, defaults
#' to [get_slf_postcode_path()] read using [read_file()].
#' @param chi_variable string, claiming chi or anon_chi.
#'
#' @return The individual file with HRI variables matched on
#' @export
Expand Down Expand Up @@ -88,42 +89,42 @@
"ooh_cases"
) %>%
flag_non_scottish_residents(slf_pc_lookup = slf_pc_lookup) %>%
dplyr::filter(scottish_resident == 0L) %>%
dplyr::filter(.data$scottish_resident == 0L) %>%

Check warning on line 92 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L92

Added line #L92 was not covered by tests
# Scotland cost and proportion
dplyr::mutate(
scotland_cost = sum(health_net_cost),
scotland_pct = (health_net_cost / scotland_cost) * 100
scotland_cost = sum(.data$health_net_cost),
scotland_pct = (.data$health_net_cost / .data$scotland_cost) * 100

Check warning on line 96 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L95-L96

Added lines #L95 - L96 were not covered by tests
) %>%
dplyr::arrange(dplyr::desc(health_net_cost)) %>%
dplyr::mutate(hri_scotp = cumsum(scotland_pct)) %>%
dplyr::arrange(dplyr::desc(.data$health_net_cost)) %>%
dplyr::mutate(hri_scotp = cumsum(.data$scotland_pct)) %>%

Check warning on line 99 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L98-L99

Added lines #L98 - L99 were not covered by tests
# Health Board
dplyr::group_by(hbrescode) %>%
dplyr::group_by(.data$hbrescode) %>%

Check warning on line 101 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L101

Added line #L101 was not covered by tests
dplyr::mutate(
hb_cost = sum(health_net_cost),
hb_pct = (health_net_cost / hb_cost) * 100
hb_cost = sum(.data$health_net_cost),
hb_pct = (.data$health_net_cost / .data$hb_cost) * 100

Check warning on line 104 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L103-L104

Added lines #L103 - L104 were not covered by tests
) %>%
dplyr::arrange(dplyr::desc(health_net_cost), .by_group = TRUE) %>%
dplyr::mutate(hri_hbp = cumsum(hb_pct)) %>%
dplyr::arrange(dplyr::desc(.data$health_net_cost), .by_group = TRUE) %>%
dplyr::mutate(hri_hbp = cumsum(.data$hb_pct)) %>%

Check warning on line 107 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L106-L107

Added lines #L106 - L107 were not covered by tests
dplyr::ungroup() %>%
# LCA
dplyr::group_by(lca) %>%
dplyr::group_by(.data$lca) %>%

Check warning on line 110 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L110

Added line #L110 was not covered by tests
dplyr::mutate(
lca_cost = sum(health_net_cost),
lca_pct = (health_net_cost / lca_cost) * 100
lca_cost = sum(.data$health_net_cost),
lca_pct = (.data$health_net_cost / .data$lca_cost) * 100

Check warning on line 113 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L112-L113

Added lines #L112 - L113 were not covered by tests
) %>%
dplyr::arrange(dplyr::desc(health_net_cost), .by_group = TRUE) %>%
dplyr::mutate(hri_lcap = cumsum(lca_pct)) %>%
dplyr::arrange(dplyr::desc(.data$health_net_cost), .by_group = TRUE) %>%
dplyr::mutate(hri_lcap = cumsum(.data$lca_pct)) %>%

Check warning on line 116 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L115-L116

Added lines #L115 - L116 were not covered by tests
dplyr::ungroup() %>%
# Add HRI flags
dplyr::mutate(
hri_scot = hri_scotp <= 50.0,
hri_hb = hri_hbp <= 50.0,
hri_lca = hri_lcap <= 50.0,
hri_scot = .data$hri_scotp <= 50.0,
hri_hb = .data$hri_hbp <= 50.0,
hri_lca = .data$hri_lcap <= 50.0,

Check warning on line 122 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L120-L122

Added lines #L120 - L122 were not covered by tests
# Deal with potential missing variables
hri_hb = dplyr::if_else(is_missing(hbrescode), FALSE, hri_hb),
hri_hbp = dplyr::if_else(is_missing(hbrescode), NA, hri_hbp),
hri_lca = dplyr::if_else(is_missing(lca), FALSE, hri_lca),
hri_lcap = dplyr::if_else(is_missing(lca), NA, hri_lcap)
hri_hb = dplyr::if_else(is_missing(.data$hbrescode), FALSE, .data$hri_hb),
hri_hbp = dplyr::if_else(is_missing(.data$hbrescode), NA, .data$hri_hbp),
hri_lca = dplyr::if_else(is_missing(.data$lca), FALSE, .data$hri_lca),
hri_lcap = dplyr::if_else(is_missing(.data$lca), NA, .data$hri_lcap)

Check warning on line 127 in R/add_hri_variables.R

View check run for this annotation

Codecov / codecov/patch

R/add_hri_variables.R#L124-L127

Added lines #L124 - L127 were not covered by tests
) %>%
# Select only required variables for the lookup
dplyr::select(
Expand Down
71 changes: 38 additions & 33 deletions R/add_keep_population_flag.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,32 @@
## Obtain the population estimates for Locality AgeGroup and Gender.
pop_estimates <-
readr::read_rds(get_pop_path(type = "datazone")) %>%
dplyr::select(year, datazone2011, sex, age0:age90plus)
dplyr::select(
.data$year,
.data$datazone2011,
.data$sex,
.data$age0:.data$age90plus

Check warning on line 23 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L19-L23

Added lines #L19 - L23 were not covered by tests
)

# Step 1: Obtain the population estimates for Locality, AgeGroup, and Gender
# Select out the estimates for the year of interest.
# if we don't have estimates for this year (and so have to use previous year).

Check warning on line 28 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=28,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 82 characters.
year_available <- pop_estimates %>%
dplyr::pull(year) %>%
dplyr::pull(.data$year) %>%

Check warning on line 30 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L30

Added line #L30 was not covered by tests
unique()

if (calendar_year %in% year_available) {
pop_estimates <- pop_estimates %>%
dplyr::filter(year == calendar_year)
dplyr::filter(.data$year == calendar_year)

Check warning on line 35 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L35

Added line #L35 was not covered by tests
} else {
previous_year <- sort(year_available, decreasing = TRUE)[1]
pop_estimates <- pop_estimates %>%
dplyr::filter(year == previous_year)
dplyr::filter(.data$year == previous_year)

Check warning on line 39 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L39

Added line #L39 was not covered by tests
}

pop_estimates <- pop_estimates %>%
# Recode gender to make it match source.
dplyr::mutate(sex = dplyr::if_else(sex == "M", 1, 2)) %>%
dplyr::mutate(sex = dplyr::if_else(.data$sex == "M", 1, 2)) %>%

Check warning on line 44 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L44

Added line #L44 was not covered by tests
dplyr::rename(
"age90" = "age90plus",
"gender" = "sex"
Expand All @@ -47,79 +52,79 @@
values_to = "population_estimate",
cols = "age0":"age90"
) %>%
dplyr::mutate(age = as.integer(age)) %>%
add_age_group(age) %>%
dplyr::mutate(age = as.integer(.data$age)) %>%
add_age_group(.data$age) %>%

Check warning on line 56 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L55-L56

Added lines #L55 - L56 were not covered by tests
dplyr::left_join(
readr::read_rds(get_locality_path()) %>%
dplyr::select("locality" = "hscp_locality", datazone2011),
dplyr::select("locality" = "hscp_locality", .data$datazone2011),

Check warning on line 59 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L59

Added line #L59 was not covered by tests
by = "datazone2011"
) %>%
dplyr::group_by(locality, age_group, gender) %>%
dplyr::summarize(population_estimate = sum(population_estimate)) %>%
dplyr::group_by(.data$locality, .data$age_group, .data$gender) %>%
dplyr::summarize(population_estimate = sum(.data$population_estimate)) %>%

Check warning on line 63 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L62-L63

Added lines #L62 - L63 were not covered by tests
dplyr::ungroup()

# Step 2: Work out the current population sizes in the SLF for Locality, AgeGroup, and Gender

Check warning on line 66 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=66,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 97 characters.
# Work out the current population sizes in the SLF for Locality AgeGroup and Gender.

Check warning on line 67 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=67,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 88 characters.
individual_file <- individual_file %>%
dplyr::mutate(age = as.integer(age)) %>%
add_age_group(age)
dplyr::mutate(age = as.integer(.data$age)) %>%
add_age_group(.data$age)

Check warning on line 70 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L69-L70

Added lines #L69 - L70 were not covered by tests


set.seed(100)
mid_year <- lubridate::dmy(stringr::str_glue("30-06-{calendar_year}"))
## issues with age being negative
# If they don't have a locality, they're no good as we won't have an estimate to match them against.

Check warning on line 76 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=76,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 104 characters.
# Same for age and gender.
nsu_keep_lookup <- individual_file %>%
dplyr::filter(gender == 1 | gender == 2) %>%
dplyr::filter(!is.na(locality), !is.na(age)) %>%
dplyr::filter(.data$gender == 1 | .data$gender == 2) %>%
dplyr::filter(!is.na(.data$locality), !is.na(.data$age)) %>%

Check warning on line 80 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L79-L80

Added lines #L79 - L80 were not covered by tests
dplyr::mutate(
# Flag service users who were dead at the mid year date.
flag_to_remove = dplyr::if_else(death_date <= mid_year & nsu == 0, 1, 0),
flag_to_remove = dplyr::if_else(.data$death_date <= mid_year & .data$nsu == 0, 1, 0),

Check warning on line 83 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L83

Added line #L83 was not covered by tests
# If the death date is missing, keep those people.
flag_to_remove = dplyr::if_else(is.na(death_date), 0, flag_to_remove),
flag_to_remove = dplyr::if_else(is.na(.data$death_date), 0, .data$flag_to_remove),

Check warning on line 85 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L85

Added line #L85 was not covered by tests
# If they are a non-service-user we want to keep them
flag_to_remove = dplyr::if_else(nsu == 1, 0, flag_to_remove)
flag_to_remove = dplyr::if_else(.data$nsu == 1, 0, .data$flag_to_remove)

Check warning on line 87 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L87

Added line #L87 was not covered by tests
) %>%
# Remove anyone who was flagged as 1 from above.
dplyr::filter(flag_to_remove == 0) %>%
dplyr::filter(.data$flag_to_remove == 0) %>%

Check warning on line 90 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L90

Added line #L90 was not covered by tests
# Calculate the populations of the whole SLF and of the NSU.
dplyr::group_by(locality, age_group, gender) %>%
dplyr::group_by(.data$locality, .data$age_group, .data$gender) %>%

Check warning on line 92 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L92

Added line #L92 was not covered by tests
dplyr::mutate(
nsu_population = sum(nsu),
nsu_population = sum(.data$nsu),

Check warning on line 94 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L94

Added line #L94 was not covered by tests
total_source_population = dplyr::n()
) %>%
dplyr::filter(nsu == 1) %>%
dplyr::filter(.data$nsu == 1) %>%

Check warning on line 97 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L97

Added line #L97 was not covered by tests
dplyr::left_join(pop_estimates,
by = c("locality", "age_group", "gender")
) %>%
dplyr::mutate(
difference = total_source_population - population_estimate,
new_nsu_figure = nsu_population - difference,
scaling_factor = new_nsu_figure / nsu_population,
scaling_factor = dplyr::case_when(scaling_factor < 0 ~ 0,
scaling_factor > 1 ~ 1,
.default = scaling_factor
difference = .data$total_source_population - .data$population_estimate,
new_nsu_figure = .data$nsu_population - .data$difference,
scaling_factor = .data$new_nsu_figure / .data$nsu_population,
scaling_factor = dplyr::case_when(.data$scaling_factor < 0 ~ 0,
.data$scaling_factor > 1 ~ 1,
.default = .data$scaling_factor

Check warning on line 107 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L102-L107

Added lines #L102 - L107 were not covered by tests
),
keep_nsu = rbinom(nsu_population, 1, scaling_factor)
keep_nsu = stats::rbinom(.data$nsu_population, 1, .data$scaling_factor)

Check warning on line 109 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L109

Added line #L109 was not covered by tests
) %>%
dplyr::filter(keep_nsu == 1L) %>%
dplyr::filter(.data$keep_nsu == 1L) %>%

Check warning on line 111 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L111

Added line #L111 was not covered by tests
dplyr::ungroup() %>%
dplyr::select(-flag_to_remove)
dplyr::select(-.data$flag_to_remove)

Check warning on line 113 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L113

Added line #L113 was not covered by tests

# step 3: match the flag back onto the slf
individual_file <- individual_file %>%
dplyr::left_join(nsu_keep_lookup,
by = "chi",
suffix = c("", ".y")
) %>%
dplyr::select(-contains(".y")) %>%
dplyr::select(-tidyselect::contains(".y")) %>%

Check warning on line 121 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L121

Added line #L121 was not covered by tests
dplyr::rename("keep_population" = "keep_nsu") %>%
dplyr::mutate(
# Flag all non-NSUs as Keep.
keep_population = dplyr::if_else(nsu == 0, 1, keep_population),
keep_population = dplyr::if_else(.data$nsu == 0, 1, .data$keep_population),

Check warning on line 125 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L125

Added line #L125 was not covered by tests
# If the flag is missing they must be a non-keep NSU so set to 0.
keep_population = dplyr::if_else(is.na(keep_population), 0, keep_population),
keep_population = dplyr::if_else(is.na(.data$keep_population), 0, .data$keep_population),

Check warning on line 127 in R/add_keep_population_flag.R

View check run for this annotation

Codecov / codecov/patch

R/add_keep_population_flag.R#L127

Added line #L127 was not covered by tests
) %>%
dplyr::select(
-c(
Expand Down
Loading
Loading