Word Tree Html Generator
x_wordtree.Rd
Creates the html code for a Google Chart's word tree for visualizing terms in context.
Arguments
- text
Text to be used for the word tree.
- targetWord
Term to be used as reference for the word tree.
- direction
The direction of the root. It can be either double (before and after the main targetWord), preffix (before), and suffix (after). The default is "double".
- window
The number of words to put before or after the main term. The default is 5.
- height
The height in pixels of the html page containing the chart. The default is 900 pixels.
Details
This is an ancillary function to kwWordTree. It generates the final html code for the Google Chart's word tree.
Examples
if (FALSE) {
# Loads the dataset on US Presidential inaugural speeches
tx <- quanteda::data_corpus_inaugural
# Find the context for the word "democracy" in the texts
x_wordtree(tx, targetWord="democracy")
}