Description Usage Arguments Details Value See Also Examples
This function tests if values in the sepcified columns have no
duplicate values. This the inverse of
duplicated
. This is a convenience function
meant to be used as a predicate in an assertr
verify statment.
1 |
... |
columns from the data.frame |
Warning: Since this uses duplicated
, the columns
are pasted together with '\t', this will fail if any of the
specified columns contain '\t' characters.
A vector of the same length that is TRUE when the values in the specified columns are distinct
1 2 3 4 5 6 7 8 | z <- data.frame(a=c(1,2,3,4,5,6), b=c(1,1,1,3,3,3), c=c(1,2,3,1,2,3))
zz <- z %>% verify(no_duplicates(a))
zz <- z %>% verify(no_duplicates(b)) # verification failed! (4 failures)
zz <- z %>% verify(no_duplicates(c)) # verification failed! (3 failures)
zz <- z %>% verify(no_duplicates(a,b))
zz <- z %>% verify(no_duplicates(a,c))
zz <- z %>% verify(no_duplicates(b,c))
zz <- z %>% verify(no_duplicates(a,b,c))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.