View source: R/descriptive_table.R
| descriptive_table | R Documentation | 
 
This function generates a table of descriptive statistics (mainly using psych::describe()) and or a correlation table. User can export this to a csv file (optionally, using the file_path argument). Users can open the csv file with MS Excel then copy and paste the table into MS Word table.
descriptive_table(
  data,
  cols,
  ...,
  digits = 3,
  descriptive_indicator = c("mean", "sd", "cor"),
  file_path = NULL,
  streamline = FALSE,
  quite = FALSE,
  show_p = FALSE,
  return_result = FALSE
)
| data | 
 | 
| cols | column(s) need to be included in the table. Support  | 
| ... | additional arguments passed to cor_test. See ?cor_test. | 
| digits | number of digit for the descriptive table | 
| descriptive_indicator | Default is mean, sd, cor. Options are missing (missing value count), non_missing (non-missing value count), cor (correlation table), n, mean, sd, median, trimmed (trimmed mean), median, mad (median absolute deviation from the median), min, max, range, skew, kurtosis, se (standard error) | 
| file_path | file path for export. The function will implicitly pass this argument to the write.csv(file = file_path) | 
| streamline | print streamlined output | 
| quite | suppress printing output | 
| show_p | Default is  | 
| return_result | If it is set to  | 
a data.frame of the descriptive table
descriptive_table(iris, cols = where(is.numeric)) # all numeric columns
descriptive_table(iris,
  cols = where(is.numeric),
  # get missing count, non-missing count, and mean & sd & correlation table
  descriptive_indicator = c("missing", "non_missing", "mean", "sd", "cor")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.