Learn R Programming

yamlet (version 0.9.3)

mimic.default: Try To Look Like Another Equal-length Variable

Description

Tries to mimic another vector or factor. If meaningful and possible, x acquires a guide attribute with labels from corresponding values in y. Any codelist attribute is removed. No guide is created for zero-length x. If x is a factor, unused codes are removed from codelist.

Usage

# S3 method for default
mimic(x, y = x, ...)

Value

same class as x

Arguments

x

vector-like

y

vector-like, same length as x

...

ignored arguments

See Also

Other mimic: mimic.classified(), mimic()

Other interface: as.data.frame.yamlet(), canonical.decorated(), classified.data.frame(), decorate.character(), decorate.data.frame(), desolve.decorated(), ggplot.decorated(), io_csv.character(), io_csv.data.frame(), io_res.character(), io_res.decorated(), io_table.character(), io_table.data.frame(), io_yamlet.character(), io_yamlet.data.frame(), is_parseable.default(), modify.default(), promote.list(), read_yamlet(), resolve.decorated(), selected.default(), write_yamlet()

Examples

Run this code
example(mimic.classified)

Run the code above in your browser using DataLab