I do some research on this topic.
- use the package
wesanderson
, I can run this script to get how many type of colors in a palette.
library(wesanderson)
library(magrittr)
wes_palette("Royal1") %>% length
#> [1] 4
Created on 2019-03-21 by the reprex package (v0.2.1)
- However, I don't how to do it for the function
scale_fill_brewer
, the fastest way now for me is to check this picture from Cookbook for R and count it.
library(RColorBrewer)
display.brewer.all()