Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

readtext_options

Get or set package options for readtext


Description

Get or set global options affecting functions across readtext.

Usage

readtext_options(..., reset = FALSE, initialize = FALSE)

Arguments

...

options to be set, as key-value pair, same as options. This may be a list of valid key-value pairs, useful for setting a group of options at once (see examples).

reset

logical; if TRUE, reset all readtext options to their default values

initialize

logical; if TRUE, reset only the readtext options that are not already defined. Used for setting initial values when some have been defined previously, such as in '.Rprofile'.

Details

Currently available options are:

verbosity

Default verbosity for messages produced when reading files. See readtext.

Value

When called using a key = value pair (where key can be a label or quoted character name)), the option is set and TRUE is returned invisibly.

When called with no arguments, a named list of the package options is returned.

When called with reset = TRUE as an argument, all arguments are options are reset to their default values, and TRUE is returned invisibly.

Examples

# save the current options
(opt <- readtext_options())

# set higher verbosity
readtext_options(verbosity = 3)

# read something in here
if (!interactive()) pkgload::load_all()
DATA_DIR <- system.file("extdata/", package = "readtext")
readtext(paste0(DATA_DIR, "/txt/UDHR/*"))

# reset to saved options
readtext_options(opt)

readtext

Import and Handling for Plain and Formatted Text Files

v0.80
GPL-3
Authors
Kenneth Benoit [aut, cre, cph], Adam Obeng [aut], Kohei Watanabe [ctb], Akitaka Matsuo [ctb], Paul Nulty [ctb], Stefan Müller [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.