Learn R Programming

polmineR (version 0.6.1)

blapply: apply a function over a list or bundle with and without verbose parallelization

Description

apply a function over a list or bundle with and without verbose parallelization

Usage

blapply(x, ...)
"blapply"(x, f, mc = TRUE, progress = TRUE, verbose = FALSE, ...)
"blapply"(x, f, mc = FALSE, progress = TRUE, verbose = FALSE, ...)

Arguments

x
a list or a bundle object
...
further parameters
f
a function that can be applied to each object contained in the bundle, note that it should swallow the parameters mc, verbose and progress (use ... to catch these params )
mc
logical, whether to use multicore - if TRUE, the number of cores will be taken from the polmineR-options
progress
logical, whether to display progress bar
verbose
logical, whether to print intermediate messages

Examples

Run this code
if (require(polmineR.sampleCorpus) && require(rcqp)){
  use(polmineR.sampleCorpus)
  bt <- partition("PLPRBTTXT", list(text_id=".*"), regex=TRUE)
  speeches <- as.speeches(bt, sAttributeDates="text_date", sAttributeNames="text_name")
  foo <- blapply(speeches, function(x, ...) slot(x, "cpos"))
}

Run the code above in your browser using DataLab