Skip to content

Commit

Permalink
Fix for anon_chi being NA
Browse files Browse the repository at this point in the history
  • Loading branch information
Moohan committed Jul 19, 2023
1 parent 4330afb commit dd39184
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/create_individual_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ create_individual_file <- function(
episode_file,
anon_chi_var = "anon_chi",
drop = TRUE
)
) %>%
dplyr::mutate(chi = dplyr::na_if(.data$chi, ""))
}

individual_file <- episode_file %>%
Expand Down Expand Up @@ -74,11 +75,10 @@ create_individual_file <- function(
dplyr::mutate(year = year)

if (anon_chi_out) {
individual_file <- slfhelper::get_anon_chi(
individual_file,
chi_var = "chi",
drop = TRUE
)
individual_file <- individual_file %>%
tidyr::replace_na(list(chi = "")) %>%
slfhelper::get_anon_chi() %>%
dplyr::mutate(anon_chi = dplyr::na_if(.data$anon_chi, ""))
}

if (write_to_disk) {
Expand Down

0 comments on commit dd39184

Please sign in to comment.