counts: Generate Counts of Values in a Vector

Description Usage Arguments Details Examples

View source: R/RcppExports.R View source: R/counts.R

Description

This function uses Rcpp sugar to implement a fast table, for unique counts of a single vector. This implementation seeks to produce identical output to table(x, useNA="ifany").

Usage

1
counts(x)

Arguments

x

A numeric, integer, character or logical vector, or a (potentially nested) list of such vectors. If x is a list, we recursively apply counts throughout elements in the list.

Details

The order of NA, NaN in the output may differ – even R is inconsistent with the order that NA and NaN elements are inserted.

Examples

1
2
x <- round( rnorm(1E2), 1 )
counts(x)

kevinushey/Kmisc documentation built on May 20, 2019, 9:08 a.m.