library("psych350lab")
pal_fn <- SPSS_pal()
pal_fn(3)[1] "#1192E8" "#005D5D" "#9F1853"
pal_fn_rev <- SPSS_pal(direction = -1)
pal_fn_rev(3)[1] "#9F1853" "#005D5D" "#1192E8"
Returns a palette function suitable for use with ggplot2 discrete scales. This is the function factory used internally by scale_color_SPSS() and scale_fill_SPSS().
SPSS_pal(version = "modern", direction = 1)
version
|
Character. “modern” (default) or “legacy”.
|
direction
|
Integer. 1 (default) for normal order, -1 for reversed.
|
A function that takes integer n and returns a character vector of n hex color codes.
library("psych350lab")
pal_fn <- SPSS_pal()
pal_fn(3)[1] "#1192E8" "#005D5D" "#9F1853"
pal_fn_rev <- SPSS_pal(direction = -1)
pal_fn_rev(3)[1] "#9F1853" "#005D5D" "#1192E8"