Learn R Programming

wordgraph (version 0.1.0)

create.centrality.variable: Return a vector with the centrality scores

Description

The function return a vector with the centrality scores of the items (i.e. words) of the variable columnwithoriginalwords. The centrality scores are retreived from the wordreport, an object that has been created previously by the function get.all.graphs.

Usage

create.centrality.variable(
  centralityfunctionstr,
  columnwithoriginalwords,
  awordreport,
  verbose = FALSE
)

Arguments

centralityfunctionstr

The type of the centrality function to use

columnwithoriginalwords

The column to look for the words

awordreport

The awordreport to look for the centrality of each word

verbose

Set to true to print every correspondence

Value

A vector containing the centralities of the words contained in columnwithoriginalwords

Examples

Run this code
# NOT RUN {
# It is a time consuming function...

# }
# NOT RUN {
 allgraphs = get.all.graphs(c("diet1stword", "diet2ndword", "diet3rdword"),
 freeassociationdata)

 centralities_vector1 = create.centrality.variable("centrality_betweenness",
 freeassociationdata$exercise1stword, allgraphs$wordreport)

 centralities_vector2 = create.centrality.variable("centrality_alpha",
 freeassociationdata$exercise1stword, allgraphs$wordreport)

 centralities_vector3 = create.centrality.variable("centrality_authority",
 freeassociationdata$exercise1stword, allgraphs$wordreport)

 centralities_vector4 = create.centrality.variable("centrality_closeness",
 freeassociationdata$exercise1stword, allgraphs$wordreport)

 centralities_vector5 = create.centrality.variable("centrality_pagerank",
 freeassociationdata$exercise1stword, allgraphs$wordreport)

 centralities_vector6 = create.centrality.variable("centrality_eigen",
 freeassociationdata$exercise1stword, allgraphs$wordreport)
 
# }

Run the code above in your browser using DataLab