label_tri: Assign shard and/or wedge based on color/color identity

Description Usage Arguments Value Note Warning See Also Examples

View source: R/label_tri.R

Description

Given a card's color (or color identity), return the Alara and/or Tarkir wedge assoicated with the card. By default, label_tri requires the card to be both all the group's colors, but if inclusive = TRUE, cards with less than three colors are labeled with all groups they could belong to.

Usage

1
2
label_tri(color_code, inclusive = FALSE, shard_or_wedge = c("either",
  "shard", "wedge"), 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 color, should label_tri return all groups that contain that color?

shard_or_wedge

Should label_tri match based on shards and wedges ("either"), just shards ("shard"), or just wedges ("wedge")?

convert_to_list

Should label_tri 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 group(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_tri inside [dplyr]mutate, you'll need to pair it with [purrr]map. Seevingette("using_label_functions").

See Also

label_guild

Examples

1
2
3
4
5
label_tri(c("B", "U", "W"))
label_tri(c("B", "U", "W"), shard_or_wedge = "shard")
label_tri(c("B", "U", "W"), shard_or_wedge = "wedge")
label_tri("U")
label_tri("U", inclusive = TRUE)

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