1

I have been struggling a ton today to make a radar chart in R. I just have an one line data nad I want to show it in nice radar chart instead of a line plot

my data is

data=tibble("AAAP family"=15,"ABC super family"=42,"ACA"=6, "ACBP60s"=4,"AGC Family"=12,"AS2 family"=5,"Acyl Lipid Metabolism Family"=167)

I have tried

library(fmsb)

  radarchart(data,  axistype=1 , 
             
             #custom polygon
             pcol=rgb(0.2,0.5,0.5,0.9) , pfcol=rgb(0.2,0.5,0.5,0.5) , plwd=4 , 
             
             #custom the grid
             cglcol="grey", cglty=1, axislabcol="grey", caxislabels=seq(0,20,5), cglwd=0.8,
             
             #custom labels
             vlcex=0.8 
  )

and many other libraries, but zero success. Any guidance is appreciated

Corrector
  • 163
  • 9
  • A simple search on: "r radar chart" turns up good solutions: https://www.datanovia.com/en/blog/beautiful-radar-chart-in-r-using-fmsb-and-ggplot-packages/ Usually good to search first before you post here to save yourself the turnaround time. – SteveM Apr 21 '23 at 14:48
  • So what about that didn't work? Try to be more specific than "zero success," as well as including what libraries didn't work and why – camille Apr 21 '23 at 14:51

1 Answers1

3

You could use ggradar:


# adding code for installing ggradar
install.packages("devtools")
devtools::install_github("ricardo-bion/ggradar", dependencies = TRUE)

# load the library in global environment
library(ggradar)

names(data) <- gsub(' ', '_', names(data))
ggradar::ggradar(data, grid.max = 200, axis.label.size = 3)

enter image description here

Manoj Kumar
  • 5,273
  • 1
  • 26
  • 33
Allan Cameron
  • 147,086
  • 7
  • 49
  • 87