eeptools (version 1.2.5)

isid: A function to check if a set of variables form a unique ID in a dataframe.

Description

When passed a set of variable names and a dataframe, this function returns a check TRUE/FALSE whether or not the variables together uniquely identify a row in the dataframe.

Usage

isid(data, vars, verbose = FALSE)

Value

TRUE or FALSE. TRUE indicates the variables uniquely identify the rows. FALSE indicates they do not.

Arguments

data

A dataframe.

vars

A character vector specifying the column names in the dataframe to check as unique.

verbose

A logical, default FALSE. If TRUE, isid will tell you how many rows you need and how many your variables uniquely identify

Author

Jared E. Knowles

Examples

Run this code
data(stuatt)
isid(stuatt, vars = c("sid"))
isid(stuatt, vars = c("sid", "school_year"))
isid(stuatt, vars = c("sid", "school_year"), verbose = TRUE)

Run the code above in your browser using DataLab