Learn R Programming

yamlet (version 1.2.1)

modify.default: Modify Attributes of Indicated Components by Default

Description

Modifies the attributes of each indicated element (all elements by default). Tries to assign the value of an expression to the supplied label, with existing attributes and the object itself (.) available as arguments. Gives a warning if the supplied label is considered reserved. Intends to support anything with one or more non-empty names.

Usage

# S3 method for default
modify(
  x,
  ...,
  .reserved = getOption("yamlet_modify_reserved", c("class", "levels", "labels",
    "names"))
)

Value

same class as x

Arguments

x

object

...

indicated columns, or name-value pairs

.reserved

reserved labels that warn on assignment

Details

The name of the component itself is available during assignments as attribute 'name' (any pre-existing attribute 'name' is temporarily masked). After all assignments are complete, the value of 'name' is enforced at the object level. Thus, modify expressions can modify component names.

As currently implemented, the expression is evaluated by eval_tidy, with attributes supplied as the data argument. Thus, names in the expression may be disambiguated, e.g. with .data. See examples.

See Also

Other modify: modify(), named(), selected(), selected.default()

Other interface: canonical.decorated(), classified.data.frame(), decorate.character(), decorate.data.frame(), desolve.decorated(), enscript.default(), 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(), mimic.default(), promote.list(), read_yamlet(), resolve.decorated(), selected.default(), write_yamlet()