Skip to content

Commit 99b7f95

Browse files
committed
Don't run previewColors when testing
1 parent 89ea1e4 commit 99b7f95

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

R/colors.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ colorFactor = function(palette, domain, levels = NULL, ordered = FALSE,
248248
#' pal = colorBin("Greens", domain = 0:100)
249249
#' pal(runif(10, 60, 100))
250250
#'
251+
#' \donttest{
251252
#' # Exponential distribution, mapped continuously
252253
#' previewColors(colorNumeric("Blues", domain = NULL), sort(rexp(16)))
253254
#' # Exponential distribution, mapped by interval
@@ -261,6 +262,7 @@ colorFactor = function(palette, domain, levels = NULL, ordered = FALSE,
261262
#' previewColors(colorFactor("RdYlBu", domain = NULL), factor(LETTERS[1:5], levels=LETTERS))
262263
#' # ...or the domain is stated explicitly.
263264
#' previewColors(colorFactor("RdYlBu", levels = LETTERS), LETTERS[1:5])
265+
#' }
264266
#' @rdname colorNumeric
265267
#' @name colorNumeric
266268
NULL

man/colorNumeric.Rd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,20 @@ The \code{palette} argument can be any of the following:
9595
pal = colorBin("Greens", domain = 0:100)
9696
pal(runif(10, 60, 100))
9797

98+
\donttest{
9899
# Exponential distribution, mapped continuously
99100
previewColors(colorNumeric("Blues", domain = NULL), sort(rexp(16)))
100101
# Exponential distribution, mapped by interval
101102
previewColors(colorBin("Blues", domain = NULL, bins = 4), sort(rexp(16)))
102103
# Exponential distribution, mapped by quantile
103104
previewColors(colorQuantile("Blues", domain = NULL), sort(rexp(16)))
104105

105-
# Categorical data; by default, the values being colored span the
106-
# gamut...
106+
# Categorical data; by default, the values being colored span the gamut...
107107
previewColors(colorFactor("RdYlBu", domain = NULL), LETTERS[1:5])
108108
# ...unless the data is a factor, without droplevels...
109109
previewColors(colorFactor("RdYlBu", domain = NULL), factor(LETTERS[1:5],
110110
levels = LETTERS))
111111
# ...or the domain is stated explicitly.
112112
previewColors(colorFactor("RdYlBu", levels = LETTERS), LETTERS[1:5])
113113
}
114+
}

0 commit comments

Comments
 (0)