graph_from_sentence: Create an igraph tree from a sentence

Description Usage Arguments Value

Description

Create an igraph tree from a data frame with token information, e.g, as donwloaded with amcat.get.tokens. This assumes that id, parent, and relation are presente in the data frame. Any other columns will be available as vertex and edge attributes (edge attributes are taken from the child token). If available, the 'word' column will be used to label the vertices. The data frame should contain a single sentence with a single root node (with no parent).

Usage

1
2
graph_from_sentence(tokens, sentence = NULL, quotes = NULL,
  clauses = NULL)

Arguments

tokens

a data frame of tokens containing id, parent, and relation columns

sentence

an optional sentence to filter the tokens (which should then contain a sentence column)

quotes

optionally, a list of quotes as returned by get_quotes

clauses

optionally, a list of clauses as returned by get_quotes

Value

an igraph graph


anon-author/clauses documentation built on May 10, 2019, 11:52 a.m.