opm_opt: Global 'opm' options

Description Usage Arguments Details Value See Also Examples

Description

Get and set global opm options, or get list of predefined parameter names of interest for the user

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  ## S4 method for signature 'character'
opm_opt(x) 
  ## S4 method for signature 'list'
opm_opt(x) 
  ## S4 method for signature 'missing'
opm_opt(x, ...) 

  ## S4 method for signature 'character'
param_names(what) 
  ## S4 method for signature 'missing'
param_names(what) 

Arguments

x

Character scalar or list or missing. If not given, all current settings are returned (as a named list). If x is a character scalar, it is used for querying for a single value.

If x is a list, it is expected to contain key-value pairs that can be set. In that case, it is an error if a key is unknown, i.e. it is an error to use a name that is not already contained (opm would never query for it anyway). It is also illegal to attempt set novel values whose classes are not identical to, or derived from, the classes of the old value. Further, it is illegal to set a zero-length value.

...

Optional arguments. If x is missing, these arguments are concatenated into a list and used as if x was given as a list (see above). That is, the argument names are used as the keys for setting values. This is usually easier than working with a list.

what

Character scalar indicating the parameters of interest. See ‘Details’.

Details

The following keys can be used with the following kinds of values:

colors

Default colour set used by the OPMS method of xy_plot and other plotting functions.

color.borders

Character vector with default colour borders between which level_plot interpolates to obtain a colour palette.

comb.key.join

Used by functions that support combination of metadata entries converted to data-frame columns immediately after their selection. Sets the character string that is used when joining old names to new name. Should normally only be a single character.

comb.value.join

Used by functions that support combination of metadata entries converted to data-frame columns immediately after their selection. Sets the character string that is used when joining old values to new values. Should normally only be a single character; must be a single character when used by opm_mcp.

contrast.type

Character scalar indicating the default type of contrast used by opm_mcp.

css.file

Character scalar. Default CSS file linked by phylo_data when producing HTML output. Ignored if empty.

csv.keys

Character vector with names of entries of csv_data be used by include_metadata. Should be kept a subset of opm_opt("csv.selection").

csv.selection

Character vector with names of entries of csv_data (must be a valid ‘keys’ argument) to be extracted by collect_template.

curve.param

Character scalar. Default ‘subset’ argument of extract and the plotting functions.

disc.param

Character scalar. Default ‘subset’ argument of do_disc. It is usually not advisable to change it.

digits

Integer scalar. Number of digits used by some functions generating output text.

file.encoding

Character scalar. Character encoding in input files as assumed by read_opm.

file.split.tmpl

Character scalar. Template used as ‘format’ argument by split_files.

gen.iii

Character scalar indicating whether read_opm and other IO functions based on it automatically convert to this plate type. If empty, nothing is changed.

group.name

Character scalar used as column name for trivial groups (either all items in the same group or each item in a group of its own) created by extract.

heatmap.colors

Colour palette used by heat_map.

html.attr

Used by phylo_data for automatically creating HTML ‘title’ and ‘class’ attributes.

input.try.order

Integer vector indicating the preferred order when trying to read CSV files with read_single_opm. See there for details.

key.join

Used by metadata and some other functions that must be in sync with it for joining metadata keys used in nested queries (because the resulting object is ‘flat’).

machine.id

Integer scalar that can be used for identifying an OmniLog(R) instrument. Useful for collect_template if several such machines are in use.

max.chars

Integer scalar used when abbreviating full substrate names. See wells for an example.

md.duration

Default name of the key to be treated as overall running time in the metadata. Currently only relevant for easing the inclusion of the total measurement duration in the metadata.

md.id.name

Default name of the key to be treated as ID in the metadata. Currently only relevant for easing the inclusion of plate-specific IDs in the metadata.

md.id.start

The first value to inserted next as ID value in the metadata. Currently only relevant for easing the inclusion of plate-specific IDs in the metadata.

min.mode

Used when making discretisation results uniform within a group. The minimum proportion the most frequent value much reach to be used for representing all values (if less, frequent, NA is used). Must be a numeric scalar between 0 and 1.

phylo.fmt

Character scalar indicating the default output format used by phylo_data.

split

Character scalar indicating the default splitting characters used by separate.

strict.OPMD

Logical scalar indicating whether OPMD objects can only be created if the discretised data are consistent with the parameter from which they have been estimated.

threshold

Numeric scalar indicating the default threshold used by annotated.

time.zone

Character scalar indicating the time zone to be used when parsing setup_time entries. This is relevant for merge, which by default attempts to sort by parsed setup times

time.fmt

Character vector indicating the time formats used for parsing the setup_time entries (in the given order). Also relevant for merge by default. It is advisable to put the more specific formats to the front because otherwise information such as an ‘AM’ or ‘PM’ indication might be lost. A wrong format might well match a given entry, causing opm to misinterpret the time or even the date.

warn.mult

Issue a warning if read_single_opm reads a multiple-plate old-style or new-style CSV file.

The following kinds of parameter names applied by opm cannot be modified by the user (but displayed using param_names):

param.names

Names of the estimated curve parameters used internally and in the output.

disc.name

Alternative name used to select discretised values instead.

reserved.md.names

Names that should not be used in metadata entries because they are used as predefined column names by functions such as flatten.

split.at

The name of the column in data frames generated by extract that separates data from metadata.

hours

The name of the column that holds the overall running time when extract is used to obtain it.

Value

List or atomic vector. If one to several values are set, the previous entries are returned invisibly.

See Also

base::options base::getOption

Other auxiliary-functions: separate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# fetching a value
(digits <- opm_opt("digits"))
stopifnot(digits == 4)

# setting a value; previous value is returned as list
(old.opts <- opm_opt(digits = 5L))
stopifnot(is.list(old.opts), length(old.opts) == 1L)
stopifnot(old.opts$digits == 4)

# fetching the value again: should now be changed
(digits <- opm_opt("digits"))
stopifnot(digits == 5)

# resetting the value
(old.opts <- opm_opt(old.opts))
stopifnot(is.list(old.opts), length(old.opts) == 1L)
stopifnot(old.opts$digits == 5)
(digits <- opm_opt("digits"))
stopifnot(digits == 4)

## reserved parameter names
(x <- param_names())
stopifnot(is.character(x), length(x) > 1, identical(unique(x), x))
(x <- param_names("reserved"))
stopifnot(is.character(x), length(x) > 1, identical(unique(x), x))
stopifnot(param_names("split.at") %in% x)

opm documentation built on May 2, 2019, 6:08 p.m.