This package exports the functionality of ggplot2 to create radar charts.
ggradar(plot.data, base.size = 15, font.radar = "sans",
values.radar = c("0%", "50%", "100%"),
axis.labels = colnames(plot.data)[-1], grid.min = 0,
grid.mid = 0.5, grid.max = 1, centre.y = grid.min - ((1/9) *
(grid.max - grid.min)), plot.extent.x.sf = 1, plot.extent.y.sf = 1.2,
x.centre.range = 0.02 * (grid.max - centre.y),
label.centre.y = FALSE, grid.line.width = 0.5,
gridline.min.linetype = "longdash",
gridline.mid.linetype = "longdash",
gridline.max.linetype = "longdash", gridline.min.colour = "grey",
gridline.mid.colour = "#007A87", gridline.max.colour = "grey",
grid.label.size = 6, gridline.label.offset = -0.1 * (grid.max -
centre.y), label.gridline.min = TRUE, label.gridline.mid = TRUE,
label.gridline.max = TRUE, axis.label.offset = 1.15,
axis.label.size = 5, axis.line.colour = "grey",
group.line.width = 1.5, group.point.size = 6, group.colours = NULL,
background.circle.colour = "#D7D6D1",
background.circle.transparency = 0.2, plot.legend = if
(nrow(plot.data) > 1) TRUE else FALSE, legend.title = "",
plot.title = "", legend.text.size = 14, legend.position = "left")
dataframe comprising one row per group
text size
text font family
values to print at minimum, 'average', and maximum gridlines
names of axis labels if other than column names supplied via plot.data
value at which mininum grid line is plotted
value at which 'average' grid line is plotted
value at which maximum grid line is plotted
value of y at centre of plot
controls relative size of plot horizontally
controls relative size of plot vertically
controls axis label alignment
whether value of y at centre of plot should be labelled
width of gridline
line type of minimum gridline
line type of 'average' gridline
line type of maximum gridline
colour of minimum gridline
colour of 'average' gridline
colour of maximum gridline
text size of gridline label
displacement to left/right of central vertical axis
whether or not to label the mininum gridline
whether or not to label the 'mininum'average' gridline
whether or not to label the maximum gridline
vertical displacement of axis labels from maximum grid line, measured relative to circle diameter
text size of axis label
colour of axis line
line width of group
point size of group
colour of group
colour of background circle/radar
transparency of background circle/radar
whether to include a plot legend
title of legend
title of radar plot
text size in legend
position of legend, valid values are "top", "right", "bottom", "left"
a ggplot object
# NOT RUN {
library(ggradar)
library(dplyr)
library(scales)
library(tibble)
mtcars_radar <- mtcars %>%
as_tibble(rownames = "group") %>%
mutate_at(vars(-group), rescale) %>%
tail(4) %>%
select(1:10)
mtcars_radar
ggradar(mtcars_radar)
# }
Run the code above in your browser using DataLab