inst/doc/palr.R

## ---- echo = FALSE, message = FALSE-------------------------------------------
##knitr::opts_chunk$set(collapse = TRUE, comment = "")
library(palr)

## -----------------------------------------------------------------------------
library(palr)
data(oisst)
image(oisst)

## -----------------------------------------------------------------------------
sstcols <- sst_pal(palette = TRUE)
image(oisst, col = sstcols$col, zlim = range(sstcols$breaks))

## ----image_pal----------------------------------------------------------------
(col <- image_pal(1:10, breaks = c(0, 4, 8, 9, 10), col = c("black", "green", "red", "blue")))
plot(1:10, col = col, pch = 19)

## ----image--------------------------------------------------------------------
image(volcano, zlim = c(130, max(volcano)))
vals <- sort(unique(volcano))
cols <- image_pal(vals, zlim = c(130, max(volcano)))
plot(vals, col = cols); abline(h = 130)

Try the palr package in your browser

Any scripts or data that you put into this service are public.

palr documentation built on Nov. 6, 2023, 9:06 a.m.