Learn R Programming

polmineR (version 0.7.0)

cooccurrences: Get cooccurrence statistics.

Description

Get cooccurrence statistics.

Usage

cooccurrences(.Object, ...)
"cooccurrences"(.Object, keep = NULL, cpos = NULL, pAttribute = "word", window = 5, method = "new", verbose = TRUE)
"cooccurrences"(.Object, window = 5, keep = list(pos = c("NN", "ADJA")), method = "ll", big = FALSE, tcm = FALSE, mc = FALSE, progress = TRUE, verbose = TRUE, ...)
"cooccurrences"(.Object, mc = getOption("polmineR.mc"), ...)

Arguments

.Object
a partition object
...
further parameters that will be passed into bigmatrix (applies only of big=TRUE)
keep
list with tokens to keep
cpos
integer vector with corpus positions, defaults to NULL - then the corpus positions for the whole corpus will be used
pAttribute
the pAttribute of the tokens
window
no of tokens to the left and to the right of nodes
method
statistical test to use (defaults to "ll")
verbose
logical, whether to be verbose
big
logical, whether to use bigmatrix
tcm
logical, if TRUE, a term-cooccurrence matrix (sparse matrix, simple_triplet_matrix) will be returned
mc
whether to use multicore
progress
logical, whether to be verbose

Value

a cooccurrences-class object

Examples

Run this code
## Not run: 
#   use(polmineR.sampleCorpus)
#   merkel <- partition("PLPRBTTXT", text_type = "speech", text_name = ".*Merkel", regex = TRUE)
#   merkel <- enrich(merkel, pAttribute = "word")
#   cooc <- cooccurrences(merkel, keep = NULL)
#   cooc <- cooccurrences(merkel, keep = NULL, big = TRUE)
# ## End(Not run)

Run the code above in your browser using DataLab