R/freq_out.R

#' Make a frequency table for a factor
#'
#' @param x factor
#'
#' @return tbl_df
#' @export
#' @examples
#' freq_out(iris$Species)
#' @importFrom dplyr %>%
freq_out <- function(x) {
  assertthat::assert_that(is.factor(x))

  xdf <- dplyr::data_frame(x)
  dplyr::count(xdf, x)
}
MaryHe/First-Package-of-Mary documentation built on May 7, 2019, 3:40 p.m.