run_document_extractor: Launch Shiny app for retrieval of documents from text...

Description Usage Arguments Examples

View source: R/run_document_extractor.R

Description

Shiny app for simple retrieval/extraction of documents from a "corporaexplorerobject" in a reading-friendly format. Interrupt R to stop the application (usually by pressing Ctrl+C or Esc).

Usage

1
run_document_extractor(corpus_object, max_html_docs = 400, ...)

Arguments

corpus_object

A corporaexplorer object created by prepare_data.

max_html_docs

The maximum number of documents allowed in one HTML report.

...

Other arguments passed to runApp in the Shiny package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Constructing test data frame:
dates <- as.Date(paste(2011:2020, 1:10, 21:30, sep = "-"))
texts <- paste0(
  "This is a document about ", month.name[1:10], ". ",
  "This is not a document about ", rev(month.name[1:10]), "."
)
titles <- paste("Text", 1:10)
test_df <- tibble::tibble(Date = dates, Text = texts, Title = titles)

# Converting to corporaexplorer object:
corpus <- prepare_data(test_df, corpus_name = "Test corpus")
if(interactive()){
# Running exploration app:
explore(corpus)

# Running app to extract documents:
run_document_extractor(corpus)
}

corporaexplorer documentation built on Nov. 13, 2020, 5:06 p.m.