zdelrosario / data-science-curriculum

https://zdelrosario.github.io/data-science-curriculum/index.html
Creative Commons Attribution Share Alike 4.0 International
24 stars 18 forks source link

Day 29 Deprecated Syntax #42

Open intermezzio opened 1 year ago

intermezzio commented 1 year ago

Day 29 (data 09) q4-setup-count has deprecated code:

rowAny <- function(x) rowSums(x) > 0
countna <- function(df, vars_lagged) {
  df %>%
    filter(rowAny(across(vars_lagged, is.na))) %>%
    dim %>%
    .[[1]]
}

countna(df_q3, c("region"))

This works now, but updated syntax would probably be ideal