rename

Rename columns, leaving every other column and the column order unchanged.

NoteExperimental

This function is experimental; its interface may change without notice.

Since 0.6.0.

Each named argument maps a new name to the old column name it replaces (rename(data, new: "old")), mirroring the dplyr rename(new = old) order. A renamed as-factor column keeps its discrete tag under the new name.

Usage

rename(
  data,
  ..renames,
)

Parameters

Parameter Default Description
data Row-store (array of dicts) or column-store (dict of arrays).
..renames Named new: "old" pairs.

Returns

A row-store array with the columns relabelled in place.

Examples

Rename hwy to highway.

#let renamed = rename(mpg, highway: "hwy")

See also

select, relocate.

Back to top