Description Usage Arguments Details Value See Also Examples
A 'cpt'
object contains the information necessary to
download the color palette from cpt-city using read_cpt
.
1 2 3 |
name |
character; the palette name (case sensitives) |
number |
character or integer; the palette number; this depends on |
check.url |
logical; should the status of the url of the color palette be tested? |
error |
logical; If |
Use list_cpt
to see all available options for the
name
and number
arguments
Setting check.url=TRUE
can add a bit
of time, since cpt-city servers have relatively long response times, but
doing so can save time downstream.
A cpt-class
object
read_cpt
to download the colors
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
Pal <- 'OrRd' # Orange to red
# See what options there are
list_cpt(pal.name == Pal)
#lets get the length-five version
n <- 5
cpt(Pal, n)
# Uses an internal check to make sure palettes do exist
try(cpt('OrangeRed', n)) # fails because the palette name is invalid
try(cpt(Pal, 999)) # fails because there isn't a variant of OrRd with that many colors
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.