Learn R Programming

polmineR (version 0.7.4)

install.corpus: Install packaged corpus from repository.

Description

Convenience function for making the installation of indexed CWB corpora wrapped into R data packages as easy as possible. Packaged corpora can then be used by calling use.

Usage

install.corpus(pkgs, repo = "http://polmine.sowi.uni-due.de/packages",
  lib = .libPaths()[1], ...)

packaged.corpora()

Arguments

pkgs

names of data packages with corpora

repo

URL of the repository

lib

directory for R packages, defaults to .libPaths()[1]; the path may not include a whitespace sign

...

further parameters that will be passed into install.packages

Details

The function combines two steps necessary to install a CWB corpus wrapped into a R data package. First, it calls install.packages, then it resets the path pointing to the directory with the indexed corpus files in the registry file.

The corpus will be installed to the standard library directory for installing R packages (.libPaths{}[1]). Another location can be used by stating the param 'lib' explicitly (see documentation for install.packages).

The function can also be used to install a corpus from a password protected repository. Further parameters are handed over to install.packages, so you might add method = "wget" extra = "--user donald --password duck".

See examples how to check whether the directory has been set correctly.

An installed data package with a CWB corpus is assumed to include a directory /extdata/cwb/registry for registry files and a directory /extdata/cwb/indexed_corpora for the inexed corpus files.

See Also

For managing registry files, see class RegistryFile, see use for switching to a packaged corpus.

Examples

Run this code
# NOT RUN {
install.corpus("plprbt.pvs2017")
# is equivalent to:
install.corpus("plprbt.pvs2017", repo = "http://polmine.sowi.uni-due.de/packages")
RegistryFile(package = "plprbt.pvs2017")$adjustHome()
# check the directory that has been set
RegistryFile$new(package = "plprbt.pvs2017")$getHome()
# }

Run the code above in your browser using DataLab