Skip to content

Commit

Permalink
fixes for r cmd check
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Apr 16, 2024
1 parent e05b176 commit e8aca30
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
3 changes: 2 additions & 1 deletion R/pal-.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#' that can be returned by the discrete palette.
#' @param x An object to test or coerce.
#' @param pal A palette to retrieve properties from.
#' @param ... Additional arguments. Currently not in use.
#'
#' @return
#' For `new_continuous_palette()`, `new_discret_palette()`, `as_discrete_pal()`
Expand Down Expand Up @@ -187,7 +188,7 @@ as_continuous_pal.pal_discrete <- function(x, ...) {
type,
color = , colour = colour_ramp(x(nlevels)),
numeric = new_continuous_palette(
approxfun(seq(0, 1, length.out = nlevels), x(nlevels)),
stats::approxfun(seq(0, 1, length.out = nlevels), x(nlevels)),
type = "numeric", na_safe = FALSE
),
cli::cli_abort(
Expand Down
2 changes: 1 addition & 1 deletion R/pal-manual.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ guess_pal_type <- function(x) {
is_color <- function(x) {
# '#' followed by 3,4,6 or 8 hex digits
grepl("^#(([[:xdigit:]]{2}){3,4}|([[:xdigit:]]){3,4})$", x) |
x %in% colours()
x %in% grDevices::colours()
}
24 changes: 24 additions & 0 deletions man/new_continuous_palette.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e8aca30

Please sign in to comment.