tabla3 | R Documentation |
I believe it only works properly for two groups right now (2020-01-21).
Creates two data frames (alocated in a list), one for continuous variables (with columns: variable, mean, sd, median and IQR for EACH level of the grouping variable and results from *t.test()* or *coin::wilcox_test()*, depeding on 'test' value), and another for categorical variables (with columns: n and percentage for each level of the grouping variable and fisher test (*fisher.test()*), p value.).
table3(data, grupo, grupo_char, digits = 3, decimal.symbol = ",", test = c("median", "mean", "both"))
data |
Data to summarize, pay attention to column types. |
grupo |
Grouping variable given as column. |
grupo_char |
Grouping variable given as character string. |
digits |
Number of decimals to round. |
A list with two data frames, first one containing the values for continuous variables and second one for categorical variables. In the continuous data frame there is going to be parameteres responding to t.test(), or coin::wilcox_test(), or both, depeding on the value of 'test' argument.
result <- table3(mtcars, mtcars$am, "am")
result
writexl::write_xlsx(result, "exported_table3.xlsx")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.