Description Usage Arguments Value Author(s) See Also Examples
Creates the ggraph object, i.e. the graph depicting the words containing the variables vector wordvars The combinations of all word pairs are computed for all concecutive pair of variables and the centrality of each word is calculated according to centralityfunction.
1 2 3 4 5 | get.graph.1.n.group.centrality.with.function(
wordvars,
centralityfunction,
data.df,
iscircled = FALSE)
|
wordvars |
The vector containing the names of the variables |
centralityfunction |
The centrality function to apply. Acceptable entries one of: tidygraph::centrality_authority(), tidygraph::centrality_betweenness(), tidygraph::centrality_closeness(), tidygraph::centrality_pagerank(), tidygraph::centrality_eigen(), tidygraph::centrality_alpha() |
data.df |
The data frame where the variables belong. |
iscircled |
Should take also the combination between last and first variable (var_n - var1)? Default is FALSE. |
A list contains the graph data for the selected centrality index.
Epaminondas Diamantopoulos
get.all.graphs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | # It is a time consuming function...
agraph = get.graph.1.n.group.centrality.with.function(
c("diet1stword", "diet2ndword", "diet3rdword"),
tidygraph::centrality_authority(),
freeassociationdata)
# To plot the graph simply call:
agraph
# The centrality scores are available at:agraph$data$centrality
hist(agraph$data$centrality)
# Other available centrality functions...
agraph = get.graph.1.n.group.centrality.with.function(
c("diet1stword", "diet2ndword", "diet3rdword"),
tidygraph::centrality_betweenness(), freeassociationdata)
# Note: closeness centrality is not well-defined for disconnected graphs.
agraph = get.graph.1.n.group.centrality.with.function(
c("diet1stword", "diet2ndword", "diet3rdword"),
tidygraph::centrality_closeness(), freeassociationdata)
agraph = get.graph.1.n.group.centrality.with.function(
c("diet1stword", "diet2ndword", "diet3rdword"),
tidygraph::centrality_pagerank(), freeassociationdata)
agraph = get.graph.1.n.group.centrality.with.function(
c("diet1stword", "diet2ndword", "diet3rdword"),
tidygraph::centrality_eigen(), freeassociationdata)
agraph = get.graph.1.n.group.centrality.with.function(
c("diet1stword", "diet2ndword", "diet3rdword"),
tidygraph::centrality_alpha(), freeassociationdata)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.