piratepal: piratepal

Description Usage Arguments Examples

View source: R/piratepal_function.R

Description

This function provides a number of color palettes

Usage

1
2
piratepal(palette = "all", trans = 0, mix.col = "white", mix.p = 0,
  plot.result = FALSE, length.out = NULL)

Arguments

palette

A string defining the color palette to use (see examples). To use a random palette, use "random". To plot all palettes, use "all". To see all palette names, use "names"

trans

A number in the interval [0, 1] indicating how transparent to make the colors. A value of 0 means no transparency and a value of 1 means completely transparency.

mix.col

string. An optional string representing a color to mix all colors in the palette with.

mix.p

numeric. A number in the interval [0, 1] indicating how much to mix the palette colors with the color in mix.col

plot.result

A logical value indicating whether or not to display the colors.

length.out

An integer indicating how many colors to return. If length.out is larger than the number of colors in the palette, colors will be repeated.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Check out the vignette for a full guide

vignette("piratepal", package = "yarrr")

# Show all palettes

piratepal(palette = "all")

# Show some palettes

piratepal(palette = "basel", trans = .5, plot.result = TRUE)


# Using a palette in a scatterplot

nemo.cols <- piratepal(palette = "nemo",  trans = .5)

set.seed(100) # For reproducibility
x <- rnorm(100)
y <- x + rnorm(100)

plot(x = x, y = y, col = nemo.cols,
    pch = 16,
    cex = runif(100, min = 0, max = 2),
    main = "piratepal('nemo', trans = .5)")

yarrr documentation built on May 30, 2017, 12:52 a.m.

Search within the yarrr package
Search all R packages, documentation and source code