Title: | Implementation of the Radar-Boxplot |
---|---|
Description: | Creates the radar-boxplot, a plot that was created by the author during his Ph.D. in forest resources. The radar-boxplot is a visualization feature suited for multivariate classification/clustering. It provides an intuitive deep understanding of the data. |
Authors: | Caio Hamamura [aut, cre] |
Maintainer: | Caio Hamamura <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.5 |
Built: | 2025-02-21 16:07:49 UTC |
Source: | https://github.com/caiohamamura/radarBoxplot-R |
Function to plot the radar-boxplot
radarBoxplot(x, ...) ## S3 method for class 'formula' radarBoxplot(x, data, ...) ## Default S3 method: radarBoxplot( x, y, IQR = 1.5, use.ggplot2 = FALSE, mfrow = NA, oma = c(5, 4, 0, 0) + 0.1, mar = c(0, 0, 1, 1) + 0.1, innerPolygon = list(), outerPolygon = list(), innerBorder = list(), outerBorder = list(), medianLine = list(), outlierPoints = list(), nTicks = 4, ticksArgs = list(), axisArgs = list(), labelsArgs = list(), angleOffset = NA, ... )
radarBoxplot(x, ...) ## S3 method for class 'formula' radarBoxplot(x, data, ...) ## Default S3 method: radarBoxplot( x, y, IQR = 1.5, use.ggplot2 = FALSE, mfrow = NA, oma = c(5, 4, 0, 0) + 0.1, mar = c(0, 0, 1, 1) + 0.1, innerPolygon = list(), outerPolygon = list(), innerBorder = list(), outerBorder = list(), medianLine = list(), outlierPoints = list(), nTicks = 4, ticksArgs = list(), axisArgs = list(), labelsArgs = list(), angleOffset = NA, ... )
x |
a data frame or matrix of attributes or a formula describing the attributes for the class |
... |
parameter to allow the usage of S3 methods |
data |
dataset for fomula variant for which formula was defined |
y |
a response vector |
IQR |
numeric. The factor to multiply the IQR to define the outlier threshold. Default 1.5 |
use.ggplot2 |
if ggplot2 are available it will use ggplot for plotting: Default FALSE |
mfrow |
mfrow argument for defining the subplots nrows and ncols: Default will calculate the minimum square |
oma |
outer margins of the subplots: Default c(5,4,0,0) + 0.1 |
mar |
margins of the subplots: Default c(0,0,1,1) + 0.1 |
innerPolygon |
a list of optional arguments to override Q2-Q3 'graphics::polygon()' style: Default list() |
outerPolygon |
a list of optional arguments to override the outer (range) 'graphics::polygon()' default style: Default list() |
innerBorder |
a list of optional arguments to override the inner border 'graphics::lines()' default style: Default list() |
outerBorder |
a list of optional arguments to override the outer border 'graphics::lines()' default style: Default list() |
medianLine |
a list of optional arguments to override the median line 'graphics::lines()' default style: Default list() |
outlierPoints |
a list of optional arguments to override the outliers 'graphics::points()' default style: Default list() |
nTicks |
number of ticks for the radar chart: Default 4 |
ticksArgs |
a list of optional arguments to override radar ticks 'graphics::lines()' default style: Default list() |
axisArgs |
a list of optional arguments to override radar axis 'graphics::lines()' default style: Default list() |
labelsArgs |
a list of optional arguments to override labels 'graphics::text()' default style: Default list() |
angleOffset |
offset for rotating the plots: Default will let the top free of axis to avoid its label overlapping the title |
library(radarBoxplot) data("winequality_red") # Regular radarBoxplot(quality ~ ., winequality_red) # Orange and green pattern with grey median radarBoxplot(quality ~ ., winequality_red, use.ggplot2=FALSE, medianLine=list(col="grey"), innerPolygon=list(col="#FFA500CC"), outerPolygon=list(col=rgb(0,.7,0,0.6))) # Plot in 2 rows and 3 columns # change columns order (counter clockwise) radarBoxplot(quality ~ volatile.acidity + citric.acid + residual.sugar + fixed.acidity + chlorides + free.sulfur.dioxide + total.sulfur.dioxide + density + pH + sulphates + alcohol, data = winequality_red, mfrow=c(2,3))
library(radarBoxplot) data("winequality_red") # Regular radarBoxplot(quality ~ ., winequality_red) # Orange and green pattern with grey median radarBoxplot(quality ~ ., winequality_red, use.ggplot2=FALSE, medianLine=list(col="grey"), innerPolygon=list(col="#FFA500CC"), outerPolygon=list(col=rgb(0,.7,0,0.6))) # Plot in 2 rows and 3 columns # change columns order (counter clockwise) radarBoxplot(quality ~ volatile.acidity + citric.acid + residual.sugar + fixed.acidity + chlorides + free.sulfur.dioxide + total.sulfur.dioxide + density + pH + sulphates + alcohol, data = winequality_red, mfrow=c(2,3))
Related to red vinho verde wine samples, from the north of Portugal. The goal is to model wine quality based on physicochemical tests
winequality_red
winequality_red
A data frame with 1599 rows and 12 variables:
https://archive.ics.uci.edu/ml/datasets/wine+quality
P. Cortez, A. Cerdeira, F. Almeida, T. Matos and J. Reis. Modeling wine preferences by data mining from physicochemical properties. In Decision Support Systems, Elsevier, 47(4):547-553, 2009.
Related to white vinho verde wine samples, from the north of Portugal. The goal is to model wine quality based on physicochemical tests
winequality_white
winequality_white
A data frame with 4898 rows and 12 variables:
https://archive.ics.uci.edu/ml/datasets/wine+quality
P. Cortez, A. Cerdeira, F. Almeida, T. Matos and J. Reis. Modeling wine preferences by data mining from physicochemical properties. In Decision Support Systems, Elsevier, 47(4):547-553, 2009.