R/04-check_table_values.R
get_unique_value_cols.Rd
This helper function extracts the names of the columns in a tibble having unique value for all observations.
get_unique_value_cols(tbl)
R object(dataframe or tibble) of the input tibble
A vector string indicating either that the tibble does not have empty columns or the names of the empty columns.
{
##### Example 1 -------------------------------------------------------------
# All columns have distinct observation
get_unique_value_cols(iris)
##### Example 2 -------------------------------------------------------------
# One column doesn't have distinct observations
get_unique_value_cols(tbl = iris[1:50,])
}
#> # A tibble: 1 × 3
#> # Rowwise:
#> condition col_name value
#> <chr> <chr> <chr>
#> 1 Unique value in the column Species setosa