Closed ptoche closed 3 years ago
Hi & thanks for the feedback.
I hesitate, as the functions already have a good number of parameters and I don't want to add too many. I will however leave the issue open so that other users can weigh in.
Meanwhile, here are a few alternatives:
pander::pander(table(tobacco$gender, useNA = 'no'), style = 'rmarkdown')
F | M |
---|---|
489 | 489 |
knitr::kable(table(tobacco$gender, useNA = 'ifany'),
col.names = c("Gender", "N"))
Gender | N |
---|---|
F | 489 |
M | 489 |
NA | 22 |
I've added a parameter "cumul" to freq(). So now you can have
> freq(tobacco$gender, cumul = FALSE, report.nas = FALSE, totals = FALSE)
Frequencies
tobacco$gender
Type: Factor
Freq %
-------- ------ -------
F 489 50.00
M 489 50.00
Just install from the "dev-current" branch to try it out:
devtools::install_github("dcomtois/summarytools", ref = "dev-current")
excellent!
New to the package. Very interesting contribution! I may have missed this: is there a way to select the columns that
freq
returns? I can remove NAs withreport.nas = FALSE
. I know I can drop theTotals
row withtotals = FALSE
. Is there an option of thefreq
function to keep/drop the percentage column and/or the cumulative percentage column?Something like
report.cum = FALSE
andreport.pct = FALSE
...