corporaexplorer (version 0.6.2)

run_corpus_explorer: Launching Shiny app for exploration of text collection

Description

Launch Shiny app for exploration of text collection. Interrupt R to stop the application (usually by pressing Ctrl+C or Esc).

Usage

run_corpus_explorer(corpus_object, use_matrix = TRUE,
  regex_engine = c("default", "stringr", "re2r"),
  optional_info = FALSE, allow_unreasonable_patterns = FALSE, ...)

Arguments

corpus_object

A corporaexplorer object created by prepare_data.

use_matrix

Logical. If the corporaexplorerobject contains a document term matrix, should it be used for searches? (See prepare_data.)

regex_engine

Specify regular expression engine to be used:

optional_info

Logical. If TRUE, information about search method (regex engine and whether the search was conducted in the document term matrix or in the full text documents).

allow_unreasonable_patterns

Logical. If FALSE, the app will not allow patterns that will result in an enormous amount of hits or will lead to a very slow search. (Examples of such patterns will include '.' and '\b'.)

...

Other arguments passed to runApp in the Shiny package.

Examples

Run this code
# NOT RUN {
# 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:
run_corpus_explorer(corpus)

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

Run the code above in your browser using DataCamp Workspace