Learn R Programming

mudata2 (version 1.1.3)

rename_values_base: Replace/rename values in a vector

Description

This function replaces character values with new character values, which is useful when performing rename operations when values are held in character vectors.

Usage

rename_values_base(
  x,
  ...,
  default_value = x,
  warn_missing = TRUE,
  warn_duplicated = TRUE
)

Value

A vector with values replaced

Arguments

x

Vector of values to replace

...

Key/value pairs in the form oldvalue="newvalue"

default_value

A vector of values to use as the default should the value not be found in ...

warn_missing

Print a message if any old names are not actually present in x

warn_duplicated

Print a message if any name appears more than once in x after the operation.