R/freq_out.R

Defines functions freq_out

Documented in freq_out

#' Make a frequency table for a factor
#'
#' @param x factor
#'
#' @return tbl_df
#' @export
#' @examples
#' freq_out(iris$Species)

freq_out <- function(x) {
  if(!is.factor(x)) stop("Not a Factor")
  xdf <- dplyr::data_frame(x)
  dplyr::count(xdf, x)
}
jeffbone/First-Package documentation built on May 19, 2019, 1:48 a.m.