plot_radar | R Documentation |
This function creates a radar chart using ggplot2.
plot_radar(data, label_x = "", label_y = "", colors = NULL)
data |
data.frame contain x, value, and variable |
label_x |
x-axis label |
label_y |
y-axis label |
colors |
color vector |
returns a ggplot graphic
data <- data.frame(name = "Petal.Length", value = mean(iris$Petal.Length))
data <- rbind(data, data.frame(name = "Petal.Width", value = mean(iris$Petal.Width)))
data <- rbind(data, data.frame(name = "Sepal.Length", value = mean(iris$Sepal.Length)))
data <- rbind(data, data.frame(name = "Sepal.Width", value = mean(iris$Sepal.Width)))
grf <- plot_radar(data, colors="red") + ggplot2::ylim(0, NA)
plot(grf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.