metOption: Get Metaplot Option with Partial Matching

Description Usage Arguments Details See Also Examples

View source: R/utils.R

Description

Gets a metaplot option value from the named list getOption('metaplot'). If an exact match is not found, trailing elements of x, separated by underscore, are removed one at a time in search of a partial match. Thus 'ref.col' will match for 'ref.col_dens' and 'ref.col_scatter' if neither of these is set (allowing selective override). However, global' will never match 'global.col'.

Usage

1
metOption(x, default = NULL)

Arguments

x

a character string holding an option name

default

the value returned if option is not set

Details

If x is missing a list of all metaplot options is returned.

See Also

getOption setOption

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
27
28
29
30
31
32
33
library(magrittr)
library(dplyr)
library(csv)
x <- as.csv(system.file(package = 'metaplot', 'extdata/theoph.csv'))
x %<>% pack

multiplot(
x %>% metaplot(conc, gg = F),
x %>% metaplot(conc, time, gg = F),
x %>% metaplot(conc, arm, gg = F),
x %>% metaplot(conc, arm,  gg = T)
)

# Add a reference line at 9 mg/L
x$conc %<>% structure(reference = 9)

# Make the reference line green universally.
setOption(ref_col = 'green')

# Make the reference line orange for density plots
setOption(ref_col_dens = 'orange')

multiplot(
x %>% metaplot(conc, gg = F),
x %>% metaplot(conc, time, gg = F),
x %>% metaplot(conc, arm, gg = F),
x %>% metaplot(conc, arm,  gg = T)
)

# Restore defaults
# setOption() # clears all metaplot options
setOption(ref_col = NULL)
setOption(ref_col_dens = NULL)

metaplot documentation built on May 1, 2019, 10:17 p.m.

Related to metOption in metaplot...