Utility function to make common tests easier.
is_unique(...)all_unique(...)
all_unique(...)
When used in a validation rule: a bare (unquoted) list of variable names. When used directly, a comma-separated list of vectors of equal length.
For is_unique A logical vector that is FALSE for each record that has a duplicate.
is_unique
FALSE
For all_unique a single TRUE or FALSE.
all_unique
TRUE
Other cross-record-helpers: exists_any(), is_complete()
exists_any()
is_complete()
# NOT RUN { d <- data.frame(X = c('a','b','c','b'), Y = c('banana','apple','banana','apple'), Z=1:4) v <- validator(is_unique(X, Y)) values(confront(d, v)) # }
Run the code above in your browser using DataLab