Learn R Programming

polmineR (version 0.7.4)

read: Display and read full text

Description

Generate text (i.e. html) and read it in the viewer pane of RStudio. If called on a "partitionBundle"-object, skip through the partitions contained in the bundle.

Usage

read(.Object, ...)

# S4 method for partition read(.Object, meta = NULL, highlight = list(), cqp = FALSE, tooltips = NULL, verbose = TRUE, cpos = FALSE, cutoff = getOption("polmineR.cutoff"), ...)

# S4 method for partitionBundle read(.Object, highlight = list(), cqp = FALSE, cpos = FALSE, ...)

# S4 method for data.table read(.Object, col, partitionBundle, cqp = FALSE, highlight = list(), cpos = FALSE, ...)

# S4 method for hits read(.Object, def, i = NULL, ...)

# S4 method for kwic read(.Object, i, type = NULL)

# S4 method for Regions read(.Object, meta = NULL)

Arguments

.Object

an object to be read ("partition" or "partitionBundle")

...

further parameters passed into read

meta

a character vector supplying s-attributes for the metainformation to be printed, if not stated explicitly, session settings will be used

highlight

a list

cqp

a list of character vectors with regular expressions to highlight relevant terms or expressions; the names of the list provide the colors

tooltips

a list

verbose

logical

cpos

logical

cutoff

maximum number of tokens to display

col

column

partitionBundle

a partitionBundle object

def

...

i

...

type

...

See Also

For concordances / a keword-in-context display, see kwic.

Examples

Run this code
# NOT RUN {
use("polmineR.sampleCorpus")
options("polmineR.meta" = "text_date")
merkel <- partition(
  "PLPRBTTXT",
   text_date="2009-11-10", text_name="Angela Dorothea Merkel",
   type="plpr"
 )
 read(merkel, meta=c("text_name", "text_date"))
 read(
   merkel,
   highlight = list(yellow=c("Deutschland", "Bundesrepublik"), lightgreen="Regierung"),
   meta = c("text_name", "text_date")
)

all <- partition("PLPRBTTXT", list(text_id=".*"), regex=TRUE, type="plpr")
speeches <- as.speeches(
  all, sAttributeDates = "text_date", sAttributeNames = "text_name", gap = 500
)
read(speeches, meta = c("text_date", "text_name"))
migVocab <- count(speeches, query=c("Migration", "Integration", "Zuwanderung"))
read(migVocab, col="Integration", partitionBundle=speeches)
# }

Run the code above in your browser using DataLab