任何使用R包summarytools的人都会遇到这个问题吗?我设置了全局summarytools选项以抑制ctable中的总数:
st_options(ctable.totals=FALSE)
而且我在函数调用中也调用了相同的代码:
with(df, ctable(
gender,
var2,
chisq = F,
headings = T,
totals = FALSE
)
但是,它仍然在实际的交叉表表数据中吐出总计。有没有人找到抑制这种情况的方法?
在更高版本的summarytools中已修复此问题。
with(tobacco, ctable(
gender,
smoker,
chisq = F,
headings = T,
totals = FALSE
))
## Cross-Tabulation, Row Proportions
## gender * smoker
## Data Frame: tobacco
##
## -------- -------- ------------- -------------
## smoker Yes No
## gender
## F 147 (30.1%) 342 (69.9%)
## M 143 (29.2%) 346 (70.8%)
## <NA> 8 (36.4%) 14 (63.6%)
## -------- -------- ------------- -------------
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句