Learn R Programming

polmineR (version 0.7.11)

registry: Get registry and data directories.

Description

The Corpus Workbench (CWB) uses a registry directory with (txt) files describing corpora in a standardized format. The binary files of a corpus are stored in a data directory defined in the registry directory. The registry and data_dir functions return the respective direcories within a package, if the argument pkg is used, or the temporary registry and data directory in the per-session temporary directory, if pkg is NULL (default value).

Usage

registry(pkg = NULL)

data_dir(pkg = NULL)

Arguments

pkg

A character string with the name of a single package; if NULL (default), the temporary registry and data directory is returned.

Value

A path to a (registry or data) directory, or NULL, if package does not exist or is not a package including a corpus.

Details

Upon loading the polmineR package, there is a check whether the environment variable CORPUS_REGISTRY is defined. In case it is, the registry files in the directory defined by the CORPUS_REGISTRY environment variable are copied to the temporary registry directory, which serves as the central place to store all registry files for all corpora, be it system corpora, corpora included in R packages, or temporary corpora.

Examples

Run this code
# NOT RUN {
registry() # returns temporary registry directory
registry(pkg = "polmineR") # returns registry directory in polmineR-package

data_dir()
data_dir(pkg = "polmineR")
# }

Run the code above in your browser using DataLab