View source: R/plot_group_term_network.R
plot_group_term_network | R Documentation |
Counts the top terms that appear in posts with a grouping variable.
Individual instances of grouping variable (e.g. Nike, Adidas) who have common words
in their top n_terms
will be placed by graph-drawing algorithm closer to those they have none in common with.
Terms common to all or multiple grouping variables will be drawn towards the middle of the network.
Terms that are uniquely associated with a specific grouping variable will be draw outwards towards the periphery of the network.
plot_group_term_network(
data,
group_var = brand,
text_var = message,
n_terms = 20,
with_ties = FALSE
)
data |
Your data frame - should have text variable and a grouping variable coded in. |
group_var |
The variable you wish to compare, should be a categorical or factor e.g. brand, entity, sentiment, country |
text_var |
The text variable |
n_terms |
Number of terms to select for each |
with_ties |
Whether to allow for > |
A network visualisation of terms associated with a grouping variable
## Not run:
Example 1:
plot_group_term_network(data, group_var = brand, text_var = text, n_terms = 15)
Example 2:
plot_group_term_network(my_data_frame, group_var = sentiment, text_var = message, n_terms = 15)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.