col_unique: Get the unique values of a dataframe column

Description Usage Arguments Value Examples

View source: R/col_unique.R

Description

Get the unique values of a dataframe column

Usage

1
col_unique(data, column, n = NULL)

Arguments

data

data.frame, dataset to be subset

column

character or column object to select

n

numeric, optional, return only the nth record

Value

vector, unique column values or nth item of unique column values

Examples

1
2
3
4
data <- tibble::tibble(country = c('USA', 'Albania', 'Borneo'), value = c(1, 2, 3))

data %>% col_unique(country)
data %>% col_unique(country, 3)

hamishgibbs/gutils documentation built on Jan. 1, 2021, 3:15 a.m.