Skip to content

Data Science Tutorials

For Data Science Learners

  • Psychological Experimentation Software
    Psychological Experimentation Software: OpenSesame Opensesame
  • How to Find Unmatched Records in R
    How to Find Unmatched Records in R R
  • similarity measure between two populations
    Similarity Measure Between Two Populations-Brunner Munzel Test Statistics
  • How to Find Optimal Clusters in R, K-means clustering is one of the most widely used clustering techniques in machine learning.
    How to Find Optimal Clusters in R? R
  • Hypothesis Testing in R
    Hypothesis Testing in R R
  • Remove Rows from the data frame in R
    Remove Rows from the data frame in R R
  • Wald Test in R With Examples
    Wald Test in R With Examples R
  • Beginner's Guide to Data Science
    Beginner’s Guide to Data Science Machine Learning
Radar plot in R

How to create Radar Plot in R-ggradar

Posted on October 21October 21 By Admin 1 Comment on How to create Radar Plot in R-ggradar

How to create Radar Plot in R, The same-named function in the package requires a data frame as input, with the first column containing the names of the groups and each subsequent column containing a variable.

How to create a ggalluvial plot in R? – Data Science Tutorials

set.seed(123)
df <- data.frame(matrix(runif(30), ncol = 10))
df[, 1] <- paste0("G", 1:3)
colnames(df) <- c("Gorup", paste("Var", 1:9))
Gorup     Var 1     Var 2     Var 3     Var 4      Var 5     Var 6     Var 7
1    G1 0.8830174 0.5281055 0.4566147 0.6775706 0.89982497 0.3279207 0.6928034
2    G2 0.9404673 0.8924190 0.9568333 0.5726334 0.24608773 0.9545036 0.6405068
3    G3 0.0455565 0.5514350 0.4533342 0.1029247 0.04205953 0.8895393 0.9942698
      Var 8     Var 9
1 0.6557058 0.5941420
2 0.7085305 0.2891597
3 0.5440660 0.1471136

Simple radar diagram

The function will produce the following graphic if the data frame is passed to it.

Keep in mind that you will need to define the lowest value and the maximum value if the values in your columns are not between 0 and 1. 

How to create a Sankey plot in R? – Data Science Tutorials

Radar chart

# install.packages("devtools")
# devtools::install_github("ricardo-bion/ggradar")
library(ggradar)
ggradar(df)

Chart labels

You can change the labels for each variable and the grid labels using with axis.labels command.

ggradar(df, values.radar = c(0, 0.5, 1),
        axis.labels = paste0("A", 1:9))

How to Add a caption to ggplot2 Plots in R? (datasciencetut.com)

Colors and types of lines

The function offers a number of arguments for altering colours, including those for the background, line, and grid colors.

lcols <- c("#EEA236", "#5CB85C", "#46B8DA")
ggradar(df,
        background.circle.colour = "white",
        axis.line.colour = "gray60",
        gridline.min.colour = "gray60",
        gridline.mid.colour = "gray60",
        gridline.max.colour = "gray60",
        group.colours = lcols)

Artificial Intelligence Examples-Quick View – Data Science Tutorials 

Customize the radar chart color in ggplot2

lcols <- c("#EEA236", "#5CB85C", "#46B8DA")
ggradar(df,
        background.circle.colour = "white",
        gridline.min.linetype = 1,
        gridline.mid.linetype = 1,
        gridline.max.linetype = 1,
        group.colours = lcols)

Customize radar chart lines in ggplot2

The legend’s title and position can both be modified with the legend.position and legend.title argument, respectively.

ggradar(df,
        legend.title = "Group",
        legend.position = "bottom")

How to Use Gather Function in R?-tidyr Part2 (datasciencetut.com)

Remove the legend

gradar(df,plot.legend = FALSE)

Check your inbox or spam folder to confirm your subscription.

R

Post navigation

Previous Post: How to create a ggalluvial plot in R?
Next Post: ggdogs on ggplot2

Related Posts

  • optim Function in R R
  • How to Check if a Directory Exists in R
    How to Check if a Directory Exists in R R
  • How to remove files and folders in R
    How to remove files and folders in R R
  • Cross product of transpose of matrix in R R
  • ggdogs on ggplot2
    ggdogs on ggplot2 R
  • Descriptive Statistics in R R

Comment (1) on “How to create Radar Plot in R-ggradar”

  1. Skillslash says:
    October 26 at 1:28 pm

    I read your blog. I found it very informative. I am a big fan of your blogs. I feel the blog aligns perfectly with our services. We are providing data science courses with real-work experience which is ideal for those who wish to have a career transition or start a fresh career path in data science along with a 100% job assurance commitment visit our website Data Science Course in pune . These courses are wonderful for professionals.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Best Prompt Engineering Books
  • Understanding Machine Learning and Data Science
  • Best Git Books
  • Top 5 Books to Learn Data Engineering
  • Mastering R Programming for Data Science: Tips and Tricks
  • About Us
  • Contact
  • Disclaimer
  • Privacy Policy

https://www.r-bloggers.com

  • YouTube
  • Twitter
  • Facebook
  • Course
  • Excel
  • Machine Learning
  • Opensesame
  • R
  • Statistics

Check your inbox or spam folder to confirm your subscription.

  • Using describeBy() in R: A Comprehensive Guide R
  • Check whether any values of a logical vector are TRUE
    Check whether any values of a logical vector are TRUE R
  • Autocorrelation and Partial Autocorrelation in Time Series
    Autocorrelation and Partial Autocorrelation in Time Series Statistics
  • Calculating Conditional Probability in R
    Calculating Conditional Probability in R R
  • Rounded corner bar plot in R
    How to make a rounded corner bar plot in R? R
  • Filtering for Unique Values
    Filtering for Unique Values in R- Using the dplyr R
  • How to Change X-Axis Labels of Barplot In R
    How to Change X-Axis Labels of Barplot In R R
  • The Multinomial Distribution in R
    The Multinomial Distribution in R R

Privacy Policy

Copyright © 2025 Data Science Tutorials.

Powered by PressBook News WordPress theme