extract_subtypes: Extract subtypes from card's type line

Description Usage Arguments Value Warning Examples

View source: R/extract_subtypes.R

Description

Take a card's type type line (stored in the type_line) column in the output from scry_cards) and get just the subtypes (everything after the '-')

Usage

1

Arguments

type_line

card's type line.

split

If the card has multiple subtypes, should extract_subtypes return a list where each subtype is its own element of the vector or one element with all subtypes (list(c("Goblin", "Warrior")) vs list("Goblin Warrior")))?

Value

list containing a character vector with the cards' subtypes

Warning

If you're using extract_subtypes inside [dplyr]mutate, you'll need to pair it with [purrr]map.

Examples

1
2
extract_subtypes("Creature - Merfolk Wizard")
extract_subtypes("Creature - Merfolk Wizard", split = TRUE)

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