Skip to contents

Make an educated guess about the name of the ID variable from a dataset

Usage

guess_ID_variable(dat, suppressWarnings = FALSE)

Arguments

dat

a dataset with names (list, data.frame, tibble)

suppressWarnings

(logical) suppress warning messages if you know what you are dooing

Value

if exactly one possible

Examples

dat <- data.frame(ID = c(1,2,3,4,5),
                 other = c(1,2,3,4,5))
guess_ID_variable(dat)
#> Warning: One possible candidate for an ID variable found: ID. This variable is used as ID.
#> [1] "ID"