I wrote some functions and scripts had to complete troubleshooting to make them work
I am not sure why I could not recall how to filter multiple values under on variable but here we are! The slice
function is also becoming one of my favorite tools.
<- pre_summary %>%
pre_numeric ::filter(skim_type == "numeric") %>%
dplyr::slice_tail(n = 6) %>%
dplyr::filter(skim_variable == "var2_avg" |
dplyr== "var1_avg" |
skim_variable == "var3_avg")
skim_variable
In this function, I have to make sure that NA values are converted to zero before I can determine success or failure. The df
has to be called first and then start the new dplyr statement.
<- function(df){
get_var_score
<- dplyr::mutate(df, var_adjusted = 4 - sc1)
df <- dplyr::mutate(df, var_avg = sc0 / var_adjusted)
df $var_avg <- tidyr::replace_na(df$var_avg, 0)
df
df ::mutate(df, var_success = if_else(var_avg >= 4.45, TRUE, FALSE))
dplyr
}
Here I needed to actually filter na
values in this column to see troubled records.
<- survey %>%
issue_13 ::filter(is.na(initials_1))
dplyr