View source: R/get_unique_col_vals.R
get_unique_col_vals | R Documentation |
Given a data frame and a column, the function will return the unique values of that column. Useful when making factors.
get_unique_col_vals(data, x)
data |
A data frame or tibble |
x |
Column in the data |
A character vector or NULL
get_unique_col_vals(data = iris,
x = Species)
iris2 <- subset(iris, Species != "setosa")
table(iris2$Species)
get_unique_col_vals(data = iris2,
x = Species)
get_unique_col_vals(data = mtcars, x = gear)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.