trinker / textplot

Plotting for text data
18 stars 1 forks source link

not mapping colors right I as gray #4

Closed trinker closed 7 years ago

trinker commented 7 years ago
library(tidyverse)

map1 <- list(
    `#FF69B4` = c('we(\'[a-z]+)?\\b'),
    `#7CFC00` = c('he(\'[a-z]+)?\\b'),
    yellow = 'you',
    gray70 = '\\bi\\b'
)

set.seed(10)
presidential_debates_2012 %>%
    dplyr::filter(person %in% c('ROMNEY', 'OBAMA')) %>%
    dplyr::group_by(person) %>%
    dplyr::sample_n(15) %$%
    hilight_term(dialogue, map1, list(person)) %>%
    plot()