relabel_mtg_color: Turn Scryfall color codes into human-readable labels

Description Usage Arguments Value Warnings See Also Examples

View source: R/relabel_mtg_color.R

Description

Color values from scry_cards come in as single character strings (e.g. "U" for blue cards). relabel_mtg_color converts them into human-readable text, (e.g. "Red" or "Multicolored").

Usage

1
relabel_mtg_color(color_code)

Arguments

color_code

character vector (which can be of length 0) containing single letter WUBRG color codes.

Value

For mono-colored cards, relabel_mtg_color returns the card's color. Otherwise, it returns "Colorless" or "Multicolored", as appropriate.

Warnings

relabel_mtg_color treats any character vector of length >1 as a multicolored card.
If you're using relabel_mtg_color inside [dplyr]mutate, you'll need to pair it with [purrr]map_chr. Seevingette("using_label_functions").

See Also

wubrg_order for converting the output into an ordered factor.

Examples

1
2

khailper/scryr documentation built on Aug. 1, 2019, 9:35 p.m.