Learn R Programming

COVID19 (version 2.0.3)

map_values: Map values

Description

Map values of a vector.

Usage

map_values(x, map)

Arguments

x

vector.

map

named vector mapping names to values.

Value

vector.

Examples

Run this code
# NOT RUN {
x <- c('red','green','red','blue')

map_values(x, map = c(
'red' = 'yellow', 
'blue' = 'orange'))

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab