proxy.factor: Calculate Substitute Values for Factor Levels

Description Usage Arguments Value See Also Examples

View source: R/proxy.R

Description

Calculates substitute values for factor levels. If x and y have same length and there is a one-to-one correspondence of their elements, then unique elements of y are returned in an order corresponding to levels(x).

Usage

1
2
## S3 method for class 'factor'
proxy(x, y = as.numeric(x), ...)

Arguments

x

factor

y

factor or vector

...

ignored

Value

same class as y

See Also

Other proxy: proxy()

Examples

1
2
3
4
5
6
7
proxy(factor(1:3), letters[1:3])
proxy(factor(1:3), factor(letters[1:3]))
proxy(factor(letters[4:6]))
foo <- classified(letters[1:5])
as_yamlet(attributes(foo))
foo <- classified(foo, labels = proxy(foo))
as_yamlet(attributes(foo))

yamlet documentation built on July 19, 2021, 1:06 a.m.