count_ids: Count the number of unique ID's

Description Usage Arguments Value Examples

View source: R/count_ids.R

Description

This function returns a value representing the number of unique values for a given variable as a nicely formatted value. In input variable could be any variable, however, the intent is for it to be a variable that identifies each unit of observation in the data (ID variable).

Usage

1
count_ids(x, description = "values", ...)

Arguments

x

A variable (vector). Typically an ID variable.

description

A character string that describes the unit of observation in the return value (e.g., "women", "participants", "schools", "cities"). The default is "values".

...

Additional arguments

Value

A character string

Examples

1
2
3
4
5
6
df <- tibble::tibble(
  id = rep(1:5, 2),
  x = rnorm(10)
)

count_ids(df$id)

brad-cannell/bfuncs documentation built on Dec. 13, 2018, 10:28 p.m.