View source: R/checkUniqueness.R
checkUniqueness | R Documentation |
Function to check if a variable is unique for all cases of an identifier variable.
checkUniqueness(GADSdat, varName, idVar)
GADSdat |
|
varName |
Single string containing the variable name for which the check should be performed. |
idVar |
Single string containing the identifier variable name. |
For example if missing values are multiple imputed and data is stored in a long format, checking the uniqueness of a variable within an identifier can be tricky. This function automates this task.
Returns either TRUE
if the variable is unique within each value for idVar
or a GADSdat
object including
the not unique cases.
## create an example GADSdat
iris2 <- iris
iris2$Species <- as.character(iris2$Species)
gads <- import_DF(iris2, checkVarNames = FALSE)
## check uniqueness
checkUniqueness(gads, varName = "Sepal.Length", idVar = "Species")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.