我想生成一个带有排序频率数据的 expss 表,以下面的在线示例为例
library(expss)
data(mtcars)
mtcars = apply_labels(mtcars,
mpg = "Miles/(US) gallon",
cyl = "Number of cylinders",
disp = "Displacement (cu.in.)",
hp = "Gross horsepower",
drat = "Rear axle ratio",
wt = "Weight (1000 lbs)",
qsec = "1/4 mile time",
vs = "Engine",
vs = c("V-engine" = 0,
"Straight engine" = 1),
am = "Transmission",
am = c("Automatic" = 0,
"Manual"=1),
gear = "Number of forward gears",
carb = "Number of carburetors"
)
mtcars %>% calc_cro_cpct(cyl, list(total(), am, vs))
但是,我希望能够通过“#Total cases”行的降序值对 Table1 进行排序。我能够对列使用 tab_sort_desc 命令,但是每当我在此命令中选择一行时,我都会收到“错误:未找到名称:...”
可以将任何命令添加到上面的代码中以按值对行进行排序?