| get.graph.1.n.group.centrality.with.function | R Documentation |
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.
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
# 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)