You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only affects calls where there's an unrepresented level in a factor variable, so this is a niche case.
Instead of:
> tabyl(sorted_with_na_and_fac$grp, sort = TRUE)
sorted_with_na_and_fac$grp n percent valid_percent
1 c 2 0.50 0.6666667
2 a 1 0.25 0.3333333
3 b NA NA NA
4 <NA> 1 0.25 NA
Return:
> tabyl(sorted_with_na_and_fac$grp, sort = TRUE)
sorted_with_na_and_fac$grp n percent valid_percent
1 c 2 0.50 0.6666667
2 a 1 0.25 0.3333333
3 b 0 0.00 0.0000000
4 <NA> 1 0.25 0.0000000
Could likely be done with:
# replace NA values with zeroes
result[is.na(result)] <- 0
Though I think I'd want to retain the NA representation of row = NA and column = valid_percent, to show that missing values is not in fact 0% once they've been filtered out.
The text was updated successfully, but these errors were encountered:
Only affects calls where there's an unrepresented level in a factor variable, so this is a niche case.
Instead of:
Return:
Could likely be done with:
Though I think I'd want to retain the NA representation of row = NA and column = valid_percent, to show that missing values is not in fact 0% once they've been filtered out.
The text was updated successfully, but these errors were encountered: