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
left_join() seems to work but as_flextable() needs to look better.
left_join()
as_flextable()
Check that cols is the same on both flextables.
cols
add a syntax in by maybe? It would be confusing with by=c(vs, am), maybe by=list(vs, am) ? or a custom wrapper?
by
by=c(vs, am)
by=list(vs, am)
library(tidyverse) library(crosstable) ct1 = crosstable(mtcars, cyl, by=vs) ct2 = crosstable(mtcars, cyl, by=am) ct = left_join(ct1, ct2, by=c(".id", "label", "variable"), suffix=c("_vs", "_am")) ct #> # A tibble: 3 × 7 #> .id label variable `0_vs` `1_vs` `0_am` `1_am` #> <chr> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 cyl cyl 4 1 (9.09%) 10 (90.91%) 3 (27.27%) 8 (72.73%) #> 2 cyl cyl 6 3 (42.86%) 4 (57.14%) 4 (57.14%) 3 (42.86%) #> 3 cyl cyl 8 14 (100.00%) 0 (0%) 12 (85.71%) 2 (14.29%) as_flextable(ct)
Created on 2022-06-16 by the reprex package (v2.0.1)
Source: https://stackoverflow.com/questions/70841416/creating-crosstable-with-multiple-variables-summarized-by-row-categories/72641518#72641518
The text was updated successfully, but these errors were encountered:
No branches or pull requests
left_join()
seems to work butas_flextable()
needs to look better.Check that
cols
is the same on both flextables.add a syntax in
by
maybe? It would be confusing withby=c(vs, am)
, maybeby=list(vs, am)
? or a custom wrapper?Created on 2022-06-16 by the reprex package (v2.0.1)
Source: https://stackoverflow.com/questions/70841416/creating-crosstable-with-multiple-variables-summarized-by-row-categories/72641518#72641518
The text was updated successfully, but these errors were encountered: