Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


gen5helper (version 1.0.1)

mapvalues_: Map the unique values of a vector

Description

Map the unique values of a vector

Usage

mapvalues_(x, facs, bNaturalSort = FALSE)

Arguments

x

factor or character

facs

character. It maps unique(x) to facs

bNaturalSort

binary. Whether to convert factor in natural order.

Value

factor

Examples

Run this code
# NOT RUN {
mapvalues_(c("A","A","B","C"), c("one", "two", "three"))
mapvalues_(c("apple", "apple", "banana", "pineable", "pineable"), c(3, 2, 1), bNaturalSort = TRUE)

# }

Run the code above in your browser using DataLab