Learn R Programming

saotd (version 0.2.0)

word_corr_network: Twitter Word Correlations Plot

Description

The word correlation network displays the mutual relationship between words. The correlation network shows higher correlations with a thicker and darker edge color.

Usage

word_corr_network(WordCorr, Correlation = 0.15, layout = "fr",
  edge_color = "royalblue", node_color = "black", node_size = 2,
  set_seed = 1234)

Arguments

WordCorr

DataFrame of Word Correlations.

Correlation

Minimum level of correlation to be displayed.

layout

Desired layout from the `ggraph` package. Acceptable layouts: "star", "circle", "gem", "dh", "graphopt", "grid", "mds", "randomly", "fr", "kk", "drl", "lgl"

edge_color

User desired edge color.

node_color

User desired node color.

node_size

User desired node size.

set_seed

Seed for reproducable results.

Value

An igraph plot

Examples

Run this code
# NOT RUN {
library(saotd)
data <- raw_tweets
tidy_data <- Tidy(DataFrame = data)
TD_Word_Corr <- word_corr(DataFrameTidy = tidy_data, 
                          number = 500,
                          sort = TRUE)
TD_Word_Corr_Network <- word_corr_network(WordCorr = TD_Word_Corr,
                                       Correlation = 0.15,
                                       layout = "fr",
                                       edge_color = "royalblue",
                                       node_color = "black",
                                       node_size = 2,
                                       set_seed = 1234)

TD_Word_Corr_Network
# }

Run the code above in your browser using DataLab