Radar Chart in R with ggradar
Radar Chart in R, additionally called a spider plot is used to visualize the values over more than one quantitative variable.
A radar chart is an informative graphical tool in which multiple variables and compared on a two-dimensional space.
In this tutorial we are going to describes how to create a radar chart in R, using ggradar R packages.
Is it possible to compare multiple variables in one place instead of a table?”
Web, polar, star, radar, or spider charts, these diagrams help us to convert complex piece of information in a simpler manner.
apply family in r apply(), lapply(), sapply(), mapply() and tapply() »
In this article you will be familiar how to create spider graphs in R.
Basically, a spider chart can be used in any situation when you need to compare multivariable information in a 2D plane.
Elements
A spider plot is easy to interpret and it contains following elements.
Center point: Core of a spider chart from which different axes are drawn.
Axis: Each axis indicates a variable
Grids: When axes are connected in a spider chart, it divides the complete graph into distinct grids that assist us to constitute facts in a higher way.
Values: Once the graph is drawn, we constitute numerous values on every axis and plot the chart for each access through allocating extraordinary colors.
Principal component analysis (PCA) in R »
Getting Data
data<- data.frame(
row.names = c("A", "B", "C"),
Thickness = c(7.9, 3.9, 9.4),
Apperance = c(10, 7, 5),
Spredability = c(3.7, 6, 2.5),
Likeability = c(8.7, 6, 4)
)
data
In this data frame contains 3 observations with 4 variables.
summarize in r, Data Summarization In R »
Thickness Apperance Spredability Likeability A 7.9 10 3.7 8.7 B 3.9 7 6.0 6.0 C 9.4 5 2.5 4.0
Let’s Load basic packages in R,
library(tidyverse) #devtools::install_github("ricardo-bion/ggradar") library("ggradar") df<-data %>% rownames_to_column("group") df
Output:-
Cluster Meaning-Cluster or area sampling in a nutshell »
group Thickness Apperance Spredability Likeability 1 A 7.9 10 3.7 8.7 2 B 3.9 7 6.0 6.0 3 C 9.4 5 2.5 4.0
ggradar( df, values.radar = c("0", "5", "10"), grid.min = 0, grid.mid = 5, grid.max = 10, # Polygons group.line.width = 1, group.point.size = 3, group.colours = c("#00AFBB", "#E7B800", "#FC4E07"), background.circle.colour = "white", gridline.mid.colour = "grey", legend.position = "bottom" )
KNN Algorithm Machine Learning » Classification & Regression »