nodeindex: Replaces node IDs with their labels.

Description Usage Arguments Value Examples

View source: R/nodeindex.R

Description

Replaces node IDs with their labels.

Usage

1
nodeindex(langnet, wordlist)

Arguments

langnet

An igraph object created using the tolangnet function.

wordlist

A list of words. Must be a character vector.

Value

An igraph object of the language network with updated labels.

Examples

1
2
3
4
5
6
7
somewords <- c('cat', 'bat', 'cap', 'cape')
somewordsnet <- tolangnet(somewords)
plot(somewordsnet) #plots the graph

somewordsnet.labelled <- nodeindex(somewordsnet, somewords)
plot(somewordsnet.labelled) #notice that this network has labels...
# note that the generated IDs are dependent on the ordering in the \code{wordlist}.

csqsiew/langnetr documentation built on May 14, 2019, 10:37 a.m.