knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

countess: Helpers for dplyr's count() Function

Convenience functions built on top of dplyr to count the number of instances of each value in columns of data frames.

Installation

You can install this development version of countess using

# install.packages("remotes")
remotes::install_github("richierocks/countess")

Example

This is a basic example which shows you how to solve a common problem:

suppressPackageStartupMessages(library(dplyr))
set.seed(19790801)
library(dplyr)
library(countess)
n <- 100
quarks <- data_frame(
  first_gen = sample(c("up", "down"), n, replace = TRUE),
  second_gen = sample(c("charm", "strange"), n, replace = TRUE),
  third_gen = factor(sample(c("top", "bottom"), n, replace = TRUE))
)
quarks %>% count_all()
quarks %>% count_at(vars(contains("ir")))
quarks %>% count_if(is.factor)


richierocks/countess documentation built on June 30, 2018, 12:02 a.m.