Learn R Programming

RcppCWB (version 0.6.7)

ids_to_count_matrix: Perform Count for Vector of IDs.

Description

The return value is a two-column integer matrix. Column one represents the unique ids of the input vector, column two the respective number of occurrences / counts.

Usage

ids_to_count_matrix(ids)

Arguments

ids

a vector of ids (integer values)

Examples

Run this code
ids <- c(1L, 5L, 5L, 7L, 7L, 7L, 7L)
ids_to_count_matrix(ids)
table(ids) # alternative to get a similar result

Run the code above in your browser using DataLab