trinker / termco

Regular Expression Counts of Terms and Substrings
Other
25 stars 5 forks source link

investigate if term_count with classify or as_terms work w/ 1 element passed to them #49

Closed trinker closed 7 years ago

trinker commented 7 years ago
library(termco)
library(dplyr)

cats <- list(
    hc = c('care', 'shealth'),
    time = c('smoment'),
    other = c('guys')    
)

model <- presidential_debates_2012 %>%
    slice(1) %>%
    with(term_count(dialogue, grouping.var = TRUE, cats))

model

model %>%
    as_terms() #error

cats <- list(
    hc = c('care', 'health'),
    time = c('moment'),
    other = c('guys')    
)

model <- presidential_debates_2012 %>%
    slice(1) %>%
    with(term_count(dialogue, grouping.var = TRUE, cats))

model %>%
    classify(3) #returns matrix