diff --git a/R/seifa.R b/R/seifa.R index 0aed079..86bf780 100644 --- a/R/seifa.R +++ b/R/seifa.R @@ -297,14 +297,14 @@ get_seifa_index_sheet <- function(filename, sheetname, structure = c("sa1", "sa2 col_names = column_names, na = c("", "NA", "-") ) %>% - dplyr::filter(if_any(ends_with("_code"), ~ !is.na(.x))) %>% + dplyr::filter(if_any(ends_with(c("_name","_code")), ~ !is.na(.x))) %>% select(-starts_with("blank")) %>% mutate( structure = structure, year = year ) %>% mutate(across( - .cols = any_of("area_code"), # Specify the column name + .cols = any_of(ends_with("_code")), # Specify the column name .fns = ~ as.character(.) # Conditionally convert to character )) %>% relocate(structure)