I am plotting points using the code:
with(data, point(x = Longitude, y = Latitude, pch = 21, bg = Fatal, col = cluster)
Where Fatal
is a factor with 2 levels (Y, N) and cluster
is a factor of 3 levels (1, 2, 3).
I have defined a color palette of 5 colors:
palette(c(rgb(255, 165, 0, alpha = 120, max = 255),
rgb(211, 211, 211, alpha = 120, max = 255),
rgb(255, 0, 0, alpha = 120, max = 255),
rgb(0, 0, 0, alpha = 255, max = 255),
rgb(255, 255, 255, alpha = 255, max = 255)))
I want to create the points such that the background color will use the first 2 colors in the palette and the border will use the last 3 colors in the palette.
Is there any way to either:
1) create 2 different color palettes to use in a points()
command?
2) tell R to use the last 3 colors in the palette for col = cluster
?
Thanks!