Learn R Programming

polmineR (version 0.6.1)

kwic: KWIC output / concordances

Description

Prepare and show concordances / keyword-in-context (kwic). The same result can be achieved by applying the kwich method on either a partition or a context object.

Usage

kwic(.Object, ...)
"kwic"(.Object, meta = getOption("polmineR.meta"), cpos = FALSE, neighbor = NULL, verbose = FALSE)
"kwic"(.Object, query, left = getOption("polmineR.left"), right = getOption("polmineR.right"), meta = getOption("polmineR.meta"), pAttribute = "word", sAttribute = NULL, cpos = TRUE, neighbor = NULL, verbose = TRUE)
"kwic"(.Object, ...)
"kwic"(.Object, query, left = getOption("polmineR.left"), right = getOption("polmineR.right"), meta = getOption("polmineR.meta"), pAttribute = "word", sAttribute = NULL, cpos = FALSE, neighbor = NULL, verbose = TRUE)

Arguments

.Object
a partition or context object, if missing, a shiny application will be launched
...
further parameters to be passed
meta
metainformation to display
cpos
logical
neighbor
only show kwic if a certain word is present
verbose
logical, whether to be talkative
query
a query, CQP-syntax can be used, then use
left
to the left
right
to the right
pAttribute
typically 'word' or 'lemma'
sAttribute
if provided, the s-attribute will be used to check the boundaries of the text

Details

If you enter "kwic()" on the console, a shiny application will be launched. The app will offer partition objects present in the global environment.

See Also

To read the whole text, see the read-method.

Examples

Run this code
## Not run: 
# if (require(polmineR.sampleCorpus) && require(rcqp)){
#   use("polmineR.sampleCorpus")
#   bt <- partition("PLPRBTTXT", def=list(text_date=".*"), regex=TRUE)
#   kwic(bt, "Integration")
#   kwic(
#     bt, "Integration",
#     left=20, right=20,
#     meta=c("text_date", "text_name", "text_party")
#   )
#   kwic(
#     bt, '"Integration" [] "(Menschen|Migrant.*|Personen)"',
#     left=20, right=20,
#     meta=c("text_date", "text_name", "text_party")
#   ) 
# }
# ## End(Not run)

Run the code above in your browser using DataLab