map_to_color: Map Vector to Colors

View source: R/map_colors.R

map_to_colorR Documentation

Map Vector to Colors

Description

Will abort if color_assignment does not contain valid colors in colors_hex_map() or hex_colors_map().

Usage

map_to_color(x, color_assignment, other)

Arguments

x

Character vector.

color_assignment

Vector of new values named with x values. NA values are viewed as "NA" strings, meaning that NA and "NA" will be treated as the same value. Map assignment should therefore be 'c("NA" = "new_value")'.

other

The value to map all other values not in color_assignment. Required only if color_assignment is incomplete.

Details

This function converts x to factor, recodes the factor, and then returns the recoded factor vector as character using map_to_value().

DETAILS

Value

A character vector of the same length as x.


meerapatelmd/suzyBakeOven documentation built on March 30, 2022, 1:44 p.m.