I have 2 lists of data.
a = c(0, 14400, 15000, 1600)
b = c(0, 1.1, 2.3, 4.5)
I would like to plot a graph using polar (radial) coordinates using radial plot. I want r=theta, so the values for the coordinates for r and theta are in the list "a".
For the color of the points I want to use list "b" to specify the colors of each point using conditions. So for example: If the value of the elemnt in b is less than 1, the color of that element is black. If the value of the element in b is between 1 and 2, the color is green. If the value of the element in b is greater than 3, the color is red.
So the resulting list would be:
c = c("black", "green", "red", "red")
The last step would be to use the list "c" to color the elements. In summary the answer to my question require 2 steps: 1) creating a new list "c" with a list of color names based on values of b 2) using list c in the radial plot to color each symbol in the plot (I don't know if this is possible)
Here is what I have so far.
pp <- radial.plot(a, a, start = -pi/3, rp.type = "s", clockwise = TRUE, point.symbols=19)
pp
The actual data is much larger, but I am providing only a small example code to focus on the 2 problems that I need to solve. I was able to generate this plot using ggplot2. However, I would prefer to use the radial.plot function in the plotrix package to this because of other reasons (the code for polar/radial coordinates seems to be much simpler and easier to use).
Please help, I'm new to R. Thank you.