idproxy: Identity Proxy

Description Usage Arguments Details Value See Also Examples

View source: R/idproxy.R

Description

Get an atomic representation of a data object.

Usage

1

Arguments

x

a data object.

Details

An ‘identity proxy’ is either an atomic vector or a dataset of identity proxies. These proxies are used to identify the distinct entries in x (or, for matrix-like x, the distinct rows). Entries in the identity proxy are distinct if and only if the corresponding entries (or rows) in x are distinct.

The default implementation is as follows:

  1. If x is an atomic vector, then idproxy(x) is x.

  2. Otherwise, if x is vector-like, then idproxy(x) is xtfrm(x).

  3. If x is matrix-like, then idproxy(x) is a dataset with columns equal to the identity proxies of the columns of x.

The idproxy should rarely (if ever) be used directly, but it is used internally buy unique.dataset and the other similar functions.

Value

An atomic vector or dataset of identity proxies used to identify the distinct entries or rows in x.

See Also

unique.dataset, xtfrm.dataset.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# atomic vectors are their own proxies
idproxy(1:20)
idproxy(letters)

# other vectors use xtfrm as a proxy
idproxy(as.hexmode(99:104))
idproxy(factor(letters))

# matrix-like objects have dataset idproxies
idproxy(matrix(1:20, 4, 5))

patperry/r-frame documentation built on May 6, 2019, 8:34 p.m.