set.kRp.env: A function to set information on your koRpus environment

Description Usage Arguments Details Value See Also Examples

View source: R/set.kRp.env.R

Description

The function set.kRp.env can be called before any of the analysing functions. It writes information on your session environment regarding the koRpus package, e.g. path to a local TreeTagger installation, to your global .Options.

Usage

1
set.kRp.env(..., validate = TRUE)

Arguments

...

Named parameters to set in the koRpus environment. Valid arguments are:

TT.cmd

A character string pointing to the tagger command you want to use for basic text analysis, or "manual" if you want to set TT.options as well. Set to "tokenize" to use tokenize.

lang

A character string specifying a valid language.

TT.options

A list with arguments to be used as TT.options by treetag.

hyph.cache.file

A character string specifying a path to a file to use for storing already hyphenated data, used by hyphen.

add.desc

A logical value, whether tag descriptions should be added directly to tagged text objects.

To explicitly unset a value again, set it to an empty character string (e.g., lang="").

validate

Logical, if TRUE given paths will be checked for actual availablity, and the function will fail if files can't be found.

Details

To get the current settings, the function get.kRp.env should be used. For the most part, set.kRp.env is a convenient wrapper for options. To permanently set some defaults, you could also add respective options calls to an .Rprofile file.

Note that you can also suppress the startup message informing about available.koRpus.lang and install.koRpus.lang by adding noStartupMessage=TRUE to the options in .Rprofile.

Value

Returns an invisible NULL.

See Also

get.kRp.env

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
set.kRp.env(lang="en")
get.kRp.env(lang=TRUE)
## Not run: 
set.kRp.env(
  TT.cmd=file.path("~","bin","treetagger","cmd","tree-tagger-german"),
  lang="de"
)

# example for setting permanent default values in an .Rprofile file
options(
  koRpus=list(
    TT.cmd="manual",
    TT.options=list(
      path=file.path("~","bin","treetagger"),
      preset="de"),
    lang="de",
    noStartupMessage=TRUE
  )
)
# be aware that setting a permamnent default language without loading
# the respective language support package might trigger errors

## End(Not run)

unDocUMeantIt/koRpus documentation built on May 21, 2021, 9:26 p.m.