View source: R/ReformatLoops.R
find_unique_case | R Documentation |
A function to find all of the unique names for a particular looped variable (e.g. livestock, crops, off-farm incomes)
find_unique_case(data, name_column)
data |
The data-frame containing the loops of concern |
name_column |
The original name of the loop (e.g. "crop_name") |
Rpackage file: ReformatLoops.R
A list of all of the unique entries for the name column
name_column <- "crop_name"
data <- tibble::as_tibble(list(
crop_name_1 = c("banana", "cassava", NA, "millet"),
crop_name_2 = c("cassava", NA, "melon", "maize"),
random_crop_name_2 = c("blue", "green", "red", NA),
crop_name = c("orange", "purple", NA, "black")
))
expected_result <- c("banana", "cassava", "millet", "melon", "maize")
find_unique_case(data, name_column)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.