r-lib / pillar
Showing 1 of 4 files from the diff.
Newly tracked file
R/options.R changed.
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)
Files Coverage
R 87.91%
Project Totals (46 files) 87.91%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
    patch:
10
      default:
11
        target: auto
12
        threshold: 1%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading