label_guild: Assign guild based on color/color identity

Description Usage Arguments Value Note Warning See Also Examples

View source: R/label_guild.R

Description

Given a card's color (or color identity), return the Ravinca guild assoicated with the card. By default, label_guild requires the card to be both of the guild's colors, but if inclusive = TRUE, mono-color cards are labeled with all guilds they could belong to.

Usage

1
label_guild(color_code, inclusive = FALSE, convert_to_list = FALSE)

Arguments

color_code

vector of characters of the card's color/color identity, using WUBRG notation. Letters must be capital and in alphabetic order. If using with link{[dplyr]mutate}, link{[purrr]map_chr}, and the results of link{scry_cards}, use the colors or color_identity column. Seevingette("using_label_functions").

inclusive

if color_code is just one (or no) color, should label_guild return all guilds that contain that color?

convert_to_list

Should label_guild a list instead of a vector? Useful if you're planning on using functions like link[tidyr]unnest.

Value

a vector of strings with all guild(s) matching the color_code

Note

cards with hybrid costs are treated as belonging to both colors, as though they were gold cards.

Warning

If you're using label_guild inside [dplyr]mutate, you'll need to pair it with [purrr]map. Seevingette("using_label_functions").

See Also

label_tri

Examples

1
2
3
label_guild(c("U", "W"))
label_guild("U")
label_guild("U", inclusive = TRUE)

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