Description Usage Arguments Value Examples
freq_vect returns a frequency table with counts and percentages of values from an atomic vector of type character, integer, double, or logical
1 |
data_vector |
an atomic vector of type character, integer, double, or logical |
sort_by_count |
boolean value that determines if output will be sorted by count or name |
total_row |
a boolean value that determines if the output will have a summary row appended |
a data_frame containing the counts and percentages of each value from the provided data
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Sample vector and data frame to demo the freq_vect function.
numbers <- sample(1:10, 200, replace = TRUE)
tbl <- data.frame(numbers = sample(1:10, 200, replace = TRUE),
letters = sample(letters, 200, replace = TRUE),
dates = sample(seq(as.Date('1999/10/01'), as.Date('2000/01/01'), by="day"),
200, replace = TRUE),
logicals = sample(c(TRUE, FALSE), 200, replace = TRUE),
stringsAsFactors = FALSE)
freq_vect(numbers)
freq_vect(tbl$numbers)
freq_vect(tbl$letters, sort_by_count = TRUE, total_row = FALSE)
freq_vect(mtcars$cyl)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.