Skip to contents

Pivot a crosstable so the variable column is spread across its values.

Usage

pivot_crosstable(ct)

Arguments

ct

a crosstable

Value

a tibble of class pivoted_crosstable

Examples

ct = crosstable(mtcars2, c(mpg, drat, wt, qsec))
p_ct = pivot_crosstable(ct)
as_flextable(p_ct)

label

Variable

Min / Max

Med [IQR]

Mean (std)

N (NA)

Miles/(US) gallon

10.4 / 33.9

19.2 [15.4;22.8]

20.1 (6.0)

32 (0)

Rear axle ratio

2.8 / 4.9

3.7 [3.1;3.9]

3.6 (0.5)

32 (0)

Weight (1000 lbs)

1.5 / 5.4

3.3 [2.6;3.6]

3.2 (1.0)

32 (0)

1/4 mile time

14.5 / 22.9

17.7 [16.9;18.9]

17.8 (1.8)

32 (0)