if (FALSE) {
ms <- c(" I ", "you")
et <- c(" it", " tell", "tru")
out1 <- word_associate(DATA2$state, DATA2$person, match.string = ms,
wordcloud = TRUE, proportional = TRUE,
network.plot = TRUE, nw.label.proportional = TRUE, extra.terms = et,
cloud.legend =c("A", "B", "C"),
title.color = "blue", cloud.colors = c("red", "purple", "gray70"))
#======================================
#Note: You don't have to name the vectors in the lists but I do for clarity
ms <- list(
list1 = c(" I ", " you", "not"),
list2 = c(" wh")
)
et <- list(
B = c(" the", "do", "tru"),
C = c(" it", " already", "we")
)
out2 <- word_associate(DATA2$state, DATA2$person, match.string = ms,
wordcloud = TRUE, proportional = TRUE,
network.plot = TRUE, nw.label.proportional = TRUE, extra.terms = et,
cloud.legend =c("A", "B", "C", "D"),
title.color = "blue", cloud.colors = c("red", "blue", "purple", "gray70"))
out3 <- word_associate(DATA2$state, list(DATA2$day, DATA2$person), match.string = ms)
#======================================
m <- list(
A1 = c("you", "in"), #list 1
A2 = c(" wh") #list 2
)
n <- list(
B = c(" the", " on"),
C = c(" it", " no")
)
out4 <- word_associate(DATA2$state, list(DATA2$day, DATA2$person),
match.string = m)
out5 <- word_associate(raj.act.1$dialogue, list(raj.act.1$person),
match.string = m)
out6 <- with(mraja1spl, word_associate(dialogue, list(fam.aff, sex),
match.string = m))
names(out6)
lapply(out6$dialogue, htruncdf, n = 20, w = 20)
#======================================
DATA2$state2 <- space_fill(DATA2$state, c("is fun", "too fun"))
ms <- list(
list1 = c(" I ", " you", "is fun", "too fun"),
list2 = c(" wh")
)
et <- list(
B = c(" the", " on"),
C = c(" it", " no")
)
out7 <- word_associate(DATA2$state2, DATA2$person, match.string = ms,
wordcloud = TRUE, proportional = TRUE,
network.plot = TRUE, nw.label.proportional = TRUE, extra.terms = et,
cloud.legend =c("A", "B", "C", "D"),
title.color = "blue", cloud.colors = c("red", "blue", "purple", "gray70"))
DATA2 <- qdap::DATA2
}
Run the code above in your browser using DataLab