I have a few colors (rgb/hex codes) that I would like to be available as defaults. I would like for the colors to be available on startup, without having to run any scripts. In other words, I would like to run the command colors() and have my custom colors show up in the list.
I suspect this list is populated from some file in the R tree, or from some other config file somewhere else. Specifically:
- What file does R pull the color definitions from?
Relevant data:
> version
_
platform x86_64-apple-darwin9.8.0
arch x86_64
os darwin9.8.0
system x86_64, darwin9.8.0
status
major 2
minor 15.1
year 2012
month 06
day 22
svn rev 59600
language R
version.string R version 2.15.1 (2012-06-22)
nickname Roasted Marshmallows
You can (if you really want), change the default palette to your own colours. For example,
Rather than providing named colours, you could also specify rgb colours using the
rgbfunction. You can add this command to your.Rprofileso it’s available on start-up.However, a better idea would be to define your own palette:
That way you don’t over-ride the default. See
?palettefor other examples.