Learn R Programming

polmineR (version 0.7.9)

use: Use a packaged corpus.

Description

Use a CWB corpus shipped in a package, or reset registry directory.

Usage

use(pkg = NULL, lib.loc = .libPaths(),
  dir = getOption("polmineR.defaultRegistry"), verbose = TRUE)

Arguments

pkg

package with a CWB indexed corpus to use (defaults to NULL)

lib.loc

a character vector with path names of R libraries

dir

a registry directory, defaults to getOption("polmineR.defaultRegistry")

verbose

logical, whether to output status messages

Value

the function returns invisibly the registry that was previously set

Details

If pkg is the name of a data package with a CWB indexed corpus, the function will reset the CORPUS_REGISTRY environment variable and re-direct the interfacing libraries (RcppCWB or rcqp) to the registry directory in the package. The registry directory is assumed to be the ./extdata/cwb/registry subdirectory of the installed package.

If pkg is NULL (default), calling use will reset the registry directory to the directory defined by dir (defaults to the option polmineR.defaultRegistry, to return to the registry that was used when loading polmineR).

When resetting the registry directory, templates for formatting fulltext output are reloaded.

See Also

the worker to reset the registry is registry_reset

Examples

Run this code
# NOT RUN {
# to get the registry directory of the sample data in the polmineR package
system.file(package = "polmineR", "extdata", "cwb", "registry")

use("polmineR")
# }

Run the code above in your browser using DataLab