data_des | R Documentation |
Category date will be presented as N(percentage). continuous data will be presented in a customized form.
data_des(
data,
row_var = c("vs", "mpg"),
col_var = NULL,
col_perc = TRUE,
fun = c("mean", "sd"),
comb_sym = c(" (", ")"),
round_cate = 1,
round_cont = 2,
p_value = TRUE,
test_name_cont = "t.test",
test_name_cate = "chisq.test",
...
)
data |
data table. |
row_var |
The variable shown on the row, can't be NUll. |
col_var |
The variable shown on the column, can be NULL. |
col_perc |
When presented the category variable, the percentage should be calculated based on row or column. Default is column. |
fun |
The function used on continuous variable. |
comb_sym |
It determines how the continuous variable will be presented. |
round_cate |
Decimal of category variable. Default is 1. |
round_cont |
Decimal of continuous variable. Default is 2. |
p_value |
If calculate the p value |
test_name_cont |
test on continuous variable |
test_name_cate |
test on category variable |
... |
Arguments given to |
Shanquan CHEN shanquan0301@gmial.com
data(mtcars)
mtcars$judge <- TRUE
mtcars$judge[3:7] <- FALSE
mtcars$judge2 <- "TRUE"
mtcars$judge2[3:7] <- "FALSE"
# continuous varialbe was shown in mean(sd)
res_tab <- data_des(data = mtcars,
row_var = c("vs", "mpg", "wt", "gear", "judge", "judge2"),
fun = c("mean", "sd"),
comb_sym = c("(", ")"),
round_cate = 2,
round_cont = 3)
res_tab
# continuous varialbe was shown in median[25% quantile, 75% quantile]
res_tab <- data_des(data = mtcars,
row_var = c("vs", "mpg", "wt", "gear", "judge", "judge2"),
fun = c("median", "quantile"),
comb_sym = c("[", "]"),
probs = c(0.25, 0.75))
res_tab
# continuous varialbe was shown in mean[25% quantile, 75% quantile]
res_tab <- data_des(data = mtcars,
row_var = c("vs", "mpg", "wt", "gear", "judge", "judge2"),
col_var = "am",
fun = c("mean", "quantile"),
comb_sym = c("[", "]"),
probs = c(0.25, 0.75),
round_cate = 2,
round_cont = 3)
res_tab
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.