hnguyen
hnguyen

Reputation: 814

ggradar: Make radar plot with value greater than the grid.max to demonstrate overgrowth

I need to demonstrate over-yielding similar to Fig.2 in this pub https://acsess.onlinelibrary.wiley.com/doi/full/10.2135/cropsci2016.01.0046.

enter image description here

enter image description here

library(tidyverse); library(ggpubr); library(fmsb); library(ggradar)

exam_scores <- data.frame(
    row.names = c("Student.1", "Student.2", "Student.3"),
      Biology = c(7.9, 3.9, 9.4),
      Physics = c(10, 20, 0),
        Maths = c(3.7, 11.5, 2.5),
        Sport = c(8.7, 20, 4),
      English = c(7.9, 7.2, 12.4),
    Geography = c(6.4, 10.5, 6.5),
          Art = c(2.4, 0.2, 9.8),
  Programming = c(0, 0, 20),
        Music = c(20, 20, 20)
)
exam_scores
# Put row names into  a column named group
df <- exam_scores %>% rownames_to_column("group")
df

This chunk produced Error: 'plot.data' contains value(s) > grid.max. How do I make ggradar accept values that are greater than its grid.max?

    df  %>% 
  ggradar(values.radar = c("5", "10", "15"),
          grid.min = 0,
  grid.mid = 7.5,
  grid.max = 15) +
  facet_wrap( ~ group, nrow = 1) +
  theme(legend.position = "none")

Upvotes: 1

Views: 167

Answers (0)

Related Questions