Determine which column(s) is(are) a key for the data

find_keys(data, max_size = 2)

Arguments

data

data frame

max_size

maximum size of the key

Value

A tibble with key size and which columns if keys exist, `FALSE` otherwise

Details

If `FALSE` is returned, this message will print: - `"No keys of size ", max_size, " found, pick larger max size"`

Examples

find_keys(college)
#> # A tibble: 106 × 2
#>    key_size columns           
#>       <int> <chr>             
#>  1        1 unitid            
#>  2        2 instnm, stabbr    
#>  3        2 instnm, adm_rate  
#>  4        2 instnm, ugds      
#>  5        2 instnm, ugds_men  
#>  6        2 instnm, ugds_women
#>  7        2 instnm, ugds_white
#>  8        2 instnm, ugds_black
#>  9        2 instnm, ugds_hisp 
#> 10        2 instnm, ugds_asian
#> # ℹ 96 more rows