mapvalues_ {gen5helper}R Documentation

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

mapvalues_(c("A","A","B","C"), c("one", "two", "three"))
mapvalues_(c("apple", "apple", "banana", "pineable", "pineable"), c(3, 2, 1), bNaturalSort = TRUE)


[Package gen5helper version 1.0.1 Index]