strange colors in palette()

I wanted to see which color numbers match up with the base colors (e.g., "red", "green", "blue"). When I run palette() I get this:

[1] "black" "#DF536B" "#61D04F" "#2297E6" "#28E2E5" "#CD0BBC" "#F5C710"
[8] "gray62"

Is this supposed to be the default color set in RStudio? If not how do I reset it? If it is, then how to I find the number associated with red/green/blue/white/etc?

You can just define colours and palettes for your plot. There are lots of different themes that you could use as well. What exactly do you want to do?

Red, green and blue are "#FF0000", "#00FF00" and "#0000FF" respectively, but unless you need these specifically you are usually better off using a palette.

The colourpicker package or even any other thing you can find online will get you the hex codes for colours anyway.

https://cran.r-project.org/web/packages/colourpicker/vignettes/colourpicker.html

Thank you very much. The problem set I was working on stated to use integers for the colors so I was trying to figure out what colors numbers 1-10 represented.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.