Similarly to unique, multiple returns a vector with only the
values that appear several times, i.e. that are actually duplicated.
Author
Mathieu Basille mathieu@basille.org
Examples
(toto <- rep(c(1:4, NA), times = 1:5))
#> [1] 1 2 2 3 3 3 4 4 4 4 NA NA NA NA NA
unique(toto)
#> [1] 1 2 3 4 NA
multiple(toto)
#> [1] 2 3 4 NA
unique(nsubset(toto, 2)) # `nsubset(x, 2)` keeps only values that occur at least twice
#> [1] 2 3 4
## Argument 'single'
multiple(toto, single = TRUE)
#> [1] 1
unique(nsubset(toto, 2, comp = "<"))
#> [1] 1
## Argument 'na.rm'
unique(toto, na.rm = TRUE)
#> [1] 1 2 3 4 NA