rggplot2radar-chartggradar

Create a radar chart in R


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


Solution

  • 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