We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why would janitor::adorn_totals("col") give a total that is different from sum(tbl$n)?
janitor::adorn_totals("col")
sum(tbl$n)
tbl <- structure(list(address_cat = structure(1:10, levels = c("[0,10]", "(10,20]", "(20,30]", "(30,40]", "(40,50]", "(50,60]", "(60,70]", "(70,80]", "(80,90]", "(90,100]"), class = "factor"), n = c(313L, 138L, 130L, 180L, 192L, 323L, 484L, 717L, 938L, 8463L)), row.names = c(NA, -10L), class = c("tbl_df", "tbl", "data.frame")) tbl # A tibble: 10 × 2 address_cat n <fct> <int> 1 [0,10] 313 2 (10,20] 138 3 (20,30] 130 4 (30,40] 180 5 (40,50] 192 6 (50,60] 323 7 (60,70] 484 8 (70,80] 717 9 (80,90] 938 10 (90,100] 8463 sum(tbl$n) # [1] 11878 tbl |> tidyr::pivot_wider(names_from = "address_cat", values_from = "n") |> janitor::adorn_totals("col") [0,10] (10,20] (20,30] (30,40] (40,50] (50,60] (60,70] (70,80] (80,90] (90,100] Total 313 138 130 180 192 323 484 717 938 8463 11565
The text was updated successfully, but these errors were encountered:
First column was excluded as indicated by the help.
Sorry, something went wrong.
No branches or pull requests
Why would
janitor::adorn_totals("col")
give a total that is different fromsum(tbl$n)
?The text was updated successfully, but these errors were encountered: