Description Usage Arguments Value Examples
Takes in a data frame/matrix/vector and calculates summary statistics based on the type.
If get_table
is TRUE
, returns a table of counts as well.
1 2 3 | summarize_vec(vec, as_vec = FALSE, get_table = FALSE, useNA = "ifany")
summarize_df(data, as_vec = FALSE, get_table = FALSE, useNA = "ifany")
|
vec |
Atomic vector. |
as_vec |
Whether to return the values as a named vector instead of a list (logical). |
get_table |
Whether to tabulate the vector as well. |
useNA |
Value to pass to table to determine whether or not to use NA values (one of "no", "ifany", and "always"). |
data |
A data frame/matrix/vector. |
List of summary statistics.
List of lists of summary statistics.
1 2 3 4 5 6 7 8 9 10 11 12 | summarize_vec(mtcars$mpg)
summarize_vec(mtcars$mpg, as_vec = TRUE)
summarize_vec(mtcars$mpg, get_table = TRUE)
summarize_vec(rownames(mtcars))
summarize_vec(c(1, 1, 1, 2, 2, NA), get_table = TRUE)
summarize_vec(c(1, 1, 1, 2, 2, NA), get_table = TRUE, useNA = "no")
summarize_vec(sample(c(TRUE, FALSE), 10, replace = TRUE))
summarize_vec(sample(c(TRUE, FALSE), 10, replace = TRUE), as_vec = TRUE)
summarize_df(mtcars)
summarize_df(mtcars, as_vec = TRUE)
summarize_df(mtcars, get_table = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.