preserving original values in ggradar plot

Viewed 196

I am using ggradar to create radar plots. I have a case like this:

library(ggradar)
library(dplyr)
library(scales)
library(tibble)

animal <- c("lion","tiger","elephant")
strength <- c(80,70,100)
speed <- c(70,100,50)
power <- c(60,50,100)
anger <- c(90,60,40)
data <- data.frame(animal,strength,speed,power,anger)
att <- c("strength","speed","power","anger")
animals <- c("elephant","tiger","lion")
data <- data[, c("animal",att)]
plot.data <- data[which(data$animal %in% animals),]
as_tibble(plot.data)

data_radar <- plot.data %>% 
  mutate_at(vars(-animal), rescale)

p <- ggradar(data_radar, 
             legend.position = "none") +
  facet_wrap(~group)

print(p)

enter image description here

Is it possible to plot the radars in a such a way that preserves the original values, which are all scores out of 100? So, for example, the scores for elephant would be plotted as 100, 50, 100 and 40, for strength, speed, power and anger respectively.

1 Answers

This could be achieved by setting the argument grid.max and grid.mid You could also set the labels via values.radar:

library(ggradar)
library(ggplot2)

ggradar(plot.data, 
             legend.position = "none", values.radar = c("0", "50", "100"), grid.max = 100, grid.mid = 50) +
  facet_wrap(~group)

Related