ricardo-bion / ggradar

radar charts with ggplot2
https://twitter.com/ricardobion
333 stars 97 forks source link

Stop overwriting factor in plot data #29

Closed caldwellst closed 5 years ago

caldwellst commented 5 years ago

If the first column of plot.data is already a factor, then this stops ggradar from overwriting the factor levels. This allows users to define factors levels and control the legend ordering as necessary.

df <- data.frame(a = factor(c("a", "b", "c"), levels = c("b", "c", "a")),
                 b = runif(3),
                 c = runif(3),
                 d = runif(3))

ggradar(df)

image