isid {eeptools}R Documentation

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)

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

Value

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

Author(s)

Jared E. Knowles

Examples

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


[Package eeptools version 1.2.4 Index]