r-lib / pillar

Compare 61b18c3 ... +4 ... eb297de

Showing 1 of 4 files from the diff.
Other files ignored by Codecov
_pkgdown.yml has changed.
NAMESPACE has changed.

@@ -2,30 +2,37 @@
Loading
2 2
#'
3 3
#' Options that affect display of tibble-like output.
4 4
#'
5 -
#' These options can be set via [options()] and queried via [getOption()].
6 -
#' For this, add a `pillar.` prefix (the package name and a dot) to the option name.
7 -
#' Example: for an option `foo`, use `options(pillar.foo = value)` to set it
8 -
#' and `getOption("pillar.foo")` to retrieve the current value.
9 -
#' An option value of `NULL` means that the default is used.
5 +
#' All options are available via the `pillar_options` list.
6 +
#' The elements of this list are combined getter/setter functions.
7 +
#' Calling a function without arguments returns the current value,
8 +
#' by providing an argument the current value is set and the old value
9 +
#' is returned, invisibly.
10 +
#' Setting `local = TRUE` enables the option for the duration of the
11 +
#' current stack frame via [rlang::local_options()].
10 12
#'
11 -
#' @format NULL
13 +
#' These options can also be set via [options()] and queried via [getOption()].
14 +
#' For this, add a `pillar.` prefix (the package name and a dot) to the option name.
15 +
#' Example: for an option `foo`,
16 +
#' `pillar_options$foo(value)` is equivalent to
17 +
#' `options(pillar.foo = value)`.
12 18
#'
19 +
#' @export
13 20
#' @examples
14 21
#' # Default setting:
15 -
#' getOption("pillar.sigfig")
22 +
#' pillar_options$sigfig()
16 23
#' pillar(1.234567)
17 24
#'
18 25
#' # Change for the duration of the session:
19 -
#' old <- options(pillar.sigfig = 6)
26 +
#' old <- pillar_options$sigfig(6)
20 27
#' pillar(1.234567)
21 28
#'
22 29
#' # Change back to the original value:
23 -
#' options(old)
30 +
#' pillar_options$sigfig(old)
24 31
#' pillar(1.234567)
25 32
#'
26 33
#' # Local scope:
27 34
#' local({
28 -
#'   rlang::local_options(pillar.sigfig = 6)
35 +
#'   pillar_options$sigfig(6, local = TRUE)
29 36
#'   pillar(1.234567)
30 37
#' })
31 38
#' pillar(1.234567)

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R 87.91%
Project Totals (46 files) 87.91%
Loading