visualize_keywords: Visualize texts

Description Usage Arguments Value Examples

View source: R/model.R

Description

This function visualizes the proportion of keywords in the documents.

Usage

1
visualize_keywords(docs, keywords, prune = TRUE, label_size = 3.2)

Arguments

docs

A list of texts read via keyATM_read() function

keywords

A list of keywords

prune

Prune keywords that do not appear in 'docs'

label_size

The size of the keyword labels

Value

A list containing

figure

a ggplot2 object

values

a tibble object that stores values

keywords

a list of keywords that appear in documents

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
 # Prepare a keyATM_docs object
 keyATM_docs <- keyATM_read(input) 
  
 # Keywords are in a list  
 keywords <- list(
                   c("education", "child", "student"),  # Education
                   c("public", "health", "program"),  # Health
                 )

 # Visualize keywords
 keyATM_viz <- visualize_keywords(keyATM_docs, keywords)

 # View a figure
 keyATM_viz
   # Or: `keyATM_viz$figure`

 # Save a figure 
 save_fig(keyATM_viz, filename)


## End(Not run)

Shusei-E/keyATM-OLD documentation built on Dec. 23, 2019, 6:42 p.m.