duplicates: Determine all duplicate elements

Description Usage Arguments Details Value See Also Examples

Description

Determines which elements of a vector or data frame are duplicates of other elements, and returns either a logical vector indicating which elements (rows) are duplicates, or the duplicated elements (rows) themselves.

Usage

1
duplicates(x, xret = FALSE, ...)

Arguments

x

a vector or a data frame or an array or NULL.

xret

logical, default FALSE returns a logical vector indicating which rows are duplicates, TRUE returns the duplicated elements.

...

additional arguments passed to duplicated.

Details

Behavior nearly identical to duplicated, except returns ALL duplicated elements, not simply the first.

Value

Numeric vector indexing rows (sample units) in spe1 which are nearest compositional neighbors of spe2. The order corresponds to row order in spe2.

See Also

duplicated, and https://stackoverflow.com/questions/7854433/.

Examples

1
2
3
4
5
6
7
8
9
x <- c('a','b','c','c','c')
y <- data.frame(x, y=c(1,2,4,4,5))
z <- as.matrix(y)
duplicates(x) # duplicate_s_
duplicated(x) # compare with duplicate_d_
duplicates(y)
duplicated(y)
duplicates(z)
duplicated(z)

phytomosaic/ecole documentation built on Jan. 2, 2022, 11:24 p.m.