powered by
Pivot a crosstable so the label column is swapped with the by row. This requires the variable column to be the same for every data column, like when all columns are numeric of when all columns are factors with the same levels
label
by
variable
transpose_crosstable(x)# S3 method for crosstable t(x)
# S3 method for crosstable t(x)
a tibble of class transposed_crosstable
transposed_crosstable
a crosstable
ct = crosstable(mtcars2, c(mpg, drat, wt, qsec), by=am) ct %>% t() %>% as_flextable() ct2 = crosstable(mtcars2, c(mpg, drat, wt, qsec), by=c(am, vs)) ct2 %>% t() %>% as_flextable()
Run the code above in your browser using DataLab