Title: | Double Box Plot for Two-Axes Correlation |
---|---|
Description: | Correlation chart of two set (x and y) of data. Using Quartiles with boxplot style. Visualize the effect of factor. |
Authors: | Shinichiro Tomizono |
Maintainer: | Shinichiro Tomizono <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.4.0 |
Built: | 2025-02-17 04:14:19 UTC |
Source: | https://github.com/cran/boxplotdbl |
Correlation chart of two set (x and y) of data. Using Quartiles with boxplot style. Visualize the effect of factor.
The DESCRIPTION file:
Package: | boxplotdbl |
Type: | Package |
Title: | Double Box Plot for Two-Axes Correlation |
Version: | 1.4.0 |
Date: | 2022-04-19 |
Author: | Shinichiro Tomizono |
Maintainer: | Shinichiro Tomizono <[email protected]> |
Description: | Correlation chart of two set (x and y) of data. Using Quartiles with boxplot style. Visualize the effect of factor. |
License: | MIT + file LICENSE |
NeedsCompilation: | no |
Packaged: | 2022-04-19 04:24:11 UTC; nara |
Date/Publication: | 2022-04-19 09:32:36 UTC |
Repository: | https://osubera.r-universe.dev |
RemoteUrl: | https://github.com/cran/boxplotdbl |
RemoteRef: | HEAD |
RemoteSha: | 5197d8359c7251beaa1d542ab0a7188bf37349bc |
Index of help topics:
boxplotdbl-package Double Box Plot for Two-Axes Correlation boxplotdou Double Box Plot
This package contains boxplotdou function. It is used for 2 sets data, to visualize the correlation of x and y axis.
Shinichiro Tomizono
Maintainer: Shinichiro Tomizono <[email protected]>
Double Box Plot: https://tomizonor.wordpress.com/2013/03/15/double-box-plot/
Double Box Plot 1.2: https://tomizonor.wordpress.com/2013/11/24/double-box-plot-1-2/
boxplotdou(Sepal.Width~Species, iris, Petal.Width~Species, iris)
boxplotdou(Sepal.Width~Species, iris, Petal.Width~Species, iris)
Extend box plot chart into two-axes (x and y) to visualize correlation.
boxplotdou(x, ...) ## Default S3 method: boxplotdou(x, y, boxed.whiskers=FALSE, outliers.has.whiskers=FALSE, name.on.axis=factor.labels, factor.labels=NULL, draw.legend=NA, condense=FALSE, condense.severity="iqr", condense.once=FALSE, col=NULL, COLOR.SHEER=bxpdou.sheer.color, shading=NA, shading.angle=NA, blackwhite=FALSE, STAT=bxpdou.boxplot.stat, verbose=FALSE, plot=TRUE, ...) ## S3 method for class 'data.frame' boxplotdou(x, y, boxed.whiskers=FALSE, outliers.has.whiskers=FALSE, name.on.axis=factor.labels, factor.labels=NULL, draw.legend=NA, condense=FALSE, condense.severity="iqr", condense.once=FALSE, col=NULL, COLOR.SHEER=bxpdou.sheer.color, shading=NA, shading.angle=NA, blackwhite=FALSE, STAT=bxpdou.boxplot.stat, verbose=FALSE, plot=TRUE, ...) ## S3 method for class 'factor' boxplotdou(x, obs.x, f.y, obs.y, boxed.whiskers=FALSE, outliers.has.whiskers=FALSE, name.on.axis=factor.labels, factor.labels=NULL, draw.legend=NA, condense=FALSE, condense.severity="iqr", condense.once=FALSE, col=NULL, COLOR.SHEER=bxpdou.sheer.color, shading=NA, shading.angle=NA, blackwhite=FALSE, STAT=bxpdou.boxplot.stat, verbose=FALSE, plot=TRUE, ...) ## S3 method for class 'formula' boxplotdou(formula.x, data.x, formula.y, data.y, boxed.whiskers=FALSE, outliers.has.whiskers=FALSE, name.on.axis=factor.labels, factor.labels=NULL, draw.legend=NA, condense=FALSE, condense.severity="iqr", condense.once=FALSE, col=NULL, COLOR.SHEER=bxpdou.sheer.color, shading=NA, shading.angle=NA, blackwhite=FALSE, STAT=bxpdou.boxplot.stat, verbose=FALSE, plot=TRUE, ...) ## S3 method for class 'list' boxplotdou(x, boxed.whiskers=FALSE, outliers.has.whiskers=FALSE, name.on.axis=factor.labels, factor.labels=NULL, draw.legend=NA, col=NULL, COLOR.SHEER=bxpdou.sheer.color, shading=NA, shading.angle=NA, blackwhite=FALSE, verbose=FALSE, plot=TRUE, ...)
boxplotdou(x, ...) ## Default S3 method: boxplotdou(x, y, boxed.whiskers=FALSE, outliers.has.whiskers=FALSE, name.on.axis=factor.labels, factor.labels=NULL, draw.legend=NA, condense=FALSE, condense.severity="iqr", condense.once=FALSE, col=NULL, COLOR.SHEER=bxpdou.sheer.color, shading=NA, shading.angle=NA, blackwhite=FALSE, STAT=bxpdou.boxplot.stat, verbose=FALSE, plot=TRUE, ...) ## S3 method for class 'data.frame' boxplotdou(x, y, boxed.whiskers=FALSE, outliers.has.whiskers=FALSE, name.on.axis=factor.labels, factor.labels=NULL, draw.legend=NA, condense=FALSE, condense.severity="iqr", condense.once=FALSE, col=NULL, COLOR.SHEER=bxpdou.sheer.color, shading=NA, shading.angle=NA, blackwhite=FALSE, STAT=bxpdou.boxplot.stat, verbose=FALSE, plot=TRUE, ...) ## S3 method for class 'factor' boxplotdou(x, obs.x, f.y, obs.y, boxed.whiskers=FALSE, outliers.has.whiskers=FALSE, name.on.axis=factor.labels, factor.labels=NULL, draw.legend=NA, condense=FALSE, condense.severity="iqr", condense.once=FALSE, col=NULL, COLOR.SHEER=bxpdou.sheer.color, shading=NA, shading.angle=NA, blackwhite=FALSE, STAT=bxpdou.boxplot.stat, verbose=FALSE, plot=TRUE, ...) ## S3 method for class 'formula' boxplotdou(formula.x, data.x, formula.y, data.y, boxed.whiskers=FALSE, outliers.has.whiskers=FALSE, name.on.axis=factor.labels, factor.labels=NULL, draw.legend=NA, condense=FALSE, condense.severity="iqr", condense.once=FALSE, col=NULL, COLOR.SHEER=bxpdou.sheer.color, shading=NA, shading.angle=NA, blackwhite=FALSE, STAT=bxpdou.boxplot.stat, verbose=FALSE, plot=TRUE, ...) ## S3 method for class 'list' boxplotdou(x, boxed.whiskers=FALSE, outliers.has.whiskers=FALSE, name.on.axis=factor.labels, factor.labels=NULL, draw.legend=NA, col=NULL, COLOR.SHEER=bxpdou.sheer.color, shading=NA, shading.angle=NA, blackwhite=FALSE, verbose=FALSE, plot=TRUE, ...)
x |
data frame,
contains two columns as factor and observation to x-axis
(for |
y |
data frame,
contains two columns as factor and observation to y-axis
(for |
obs.x |
numeric vector, as observation to x-axis (for |
f.y |
factor vector, as factor to y-axis (for |
obs.y |
numeric vector, as observation to y-axis (for |
formula.x |
formula, a model formula to x-axis, eg. |
data.x |
data.frame, contains variables in formula.x
(for |
formula.y |
formula, a model formula to y-axis, eg. |
data.y |
data.frame, contains variables in formula.y
(for |
boxed.whiskers |
logical, default is FALSE, TRUE to draw rectangular range rather than whisker and staple. |
outliers.has.whiskers |
logical, default is FALSE, extend whisker and staple through outliers. |
name.on.axis |
control labels on each group on axes,
default is |
factor.labels |
control labels on each group on factor, default is NULL, using factor data, TRUE to abbreviate by alphabet letters, FALSE to draw no labels, character vector to give explicit labels, single character to use identical character, NA in vector to exclude any groups. |
draw.legend |
logical, draw legend or not, default is NA, enable legend only when labels abbreviated. |
condense |
logical, default is FALSE, TRUE to unify near groups into one box. |
condense.severity |
character, default is |
condense.once |
logical, default is FALSE,
TRUE to disable recursive condenses,
used only when |
col |
character vector, colors for each group, default is NULL, automatic colors. |
COLOR.SHEER |
function, to convert color to sheer color,
default is |
shading |
numeric vector,
as shading density to draw inside of box.
default is NA, means automatic,
no shadings when both
logical value TRUE has a special meaning to enable shading with automatic densities. |
shading.angle |
numeric vector,
as shading angle to draw inside of box.
default is NA, means automatic,
no shadings when both |
blackwhite |
logical, default is FALSE,
TRUE to draw black and white chart,
equivalent to set following 3 parameters,
|
STAT |
function, default is |
plot |
if FALSE is given, it disable to plot and print a summary. default is TRUE. |
verbose |
if TRUE is given, it print verbose debugging information. default is FALSE. |
... |
plot parameters and boxplot color parameters are acceptable. |
This function is designed to visualize a correlation
between 2 sets of independent observation with common
factors.
Such as, the plant height v.s. the soil pH by location.
This function depends on boxplot
function
to calculate summaries such as IQRs.
This dependency can be overridden by STAT
argument.
A summary list is explicitly printed when plot=FALSE is given, and is invisibly returned when plot=TRUE.
stat |
|
name |
|
level |
character vecotr of factor names |
Each summary of x and y is identical to boxplot
statistics,
stats |
matrix, each column contains the extreme of the lower whisker, the lower hinge, the median, the upper hinge and the extreme of the upper whisker. |
n |
numerical vector, sample numbers of each factor level. |
conf |
matrix, each column contains the lower and upper extremes of the notch. |
out |
numerical vector, outliers |
group |
numerical vector of same length as |
names |
character vector, each name of factor levels. |
default is NULL, to use black, colors for median labels.
default is NULL, to use col
,
colors for whiskers.
default is NULL, to use col
,
colors for staples.
default is NULL, to use black, colors for box borders.
default is NULL, to use col
,
colors for outliers.
default is NULL, to use transparent, colors inside outliers.
default is 2, size of outliers.
default is 1, to use a transparent circle,
symbol number of outliers, as graphic par
pch
.
Shinichiro Tomizono
Double Box Plot: https://tomizonor.wordpress.com/2013/03/15/double-box-plot/
Double Box Plot 1.2: https://tomizonor.wordpress.com/2013/11/24/double-box-plot-1-2/
# iris data: Sepal.Length v.s. Sepal.Width by Species stat <- boxplotdou(iris[c(5,1)], iris[c(5,2)]) boxplotdou(iris[,5], iris[,1], iris[,5], iris[,2]) boxplotdou(Sepal.Length~Species, iris, Sepal.Width~Species, iris) boxplotdou(stat, main='redraw by saved stat') # color and shading boxplotdou(iris[c(5,1)], iris[c(5,2)], col=c('wheat','wheat','black'), boxcol='springgreen') boxplotdou(iris[c(5,1)], iris[c(5,2)], shading=c(3,5)) boxplotdou(iris[c(5,1)], iris[c(5,2)], shading=5, shading.angle=c(0,90)) boxplotdou(iris[c(5,1)], iris[c(5,2)], blackwhite=TRUE) # customized sheer funtion mysheer <- function(x) adjustcolor(x, alpha.f=0.2, red.f=0.3, green.f=0.3, blue.f=0.3) boxplotdou(iris[c(5,1)], iris[c(5,2)], COLOR.SHEER=mysheer) # whisker boxplotdou(iris[c(5,1)], iris[c(5,2)], boxed.whiskers=TRUE) boxplotdou(iris[c(5,1)], iris[c(5,2)], outliers.has.whiskers=TRUE) # condense boxplotdou(iris[c(5,1)], iris[c(5,2)], condense=TRUE) # labels boxplotdou(iris[c(5,1)], iris[c(5,2)], factor.labels=FALSE) boxplotdou(iris[c(5,1)], iris[c(5,2)], factor.labels=TRUE) boxplotdou(iris[c(5,1)], iris[c(5,2)], factor.labels=TRUE, draw.legend=FALSE) boxplotdou(iris[c(5,1)], iris[c(5,2)], factor.labels=c('Se','Ve','Vi')) boxplotdou(iris[c(5,1)], iris[c(5,2)], factor.labels='+', name.on.axis=FALSE) # customized summary function mystat <- function(x) boxplot(formula=x, range=1, plot=FALSE) boxplotdou(iris[c(5,1)], iris[c(5,2)], STAT=mystat) # graphic parameters boxplotdou(iris[c(5,1)], iris[c(5,2)], xlim=c(4.8, 7.0), ylim=c(2.0, 3.5)) # print summary boxplotdou(iris[c(5,1)], iris[c(5,2)], plot=FALSE)
# iris data: Sepal.Length v.s. Sepal.Width by Species stat <- boxplotdou(iris[c(5,1)], iris[c(5,2)]) boxplotdou(iris[,5], iris[,1], iris[,5], iris[,2]) boxplotdou(Sepal.Length~Species, iris, Sepal.Width~Species, iris) boxplotdou(stat, main='redraw by saved stat') # color and shading boxplotdou(iris[c(5,1)], iris[c(5,2)], col=c('wheat','wheat','black'), boxcol='springgreen') boxplotdou(iris[c(5,1)], iris[c(5,2)], shading=c(3,5)) boxplotdou(iris[c(5,1)], iris[c(5,2)], shading=5, shading.angle=c(0,90)) boxplotdou(iris[c(5,1)], iris[c(5,2)], blackwhite=TRUE) # customized sheer funtion mysheer <- function(x) adjustcolor(x, alpha.f=0.2, red.f=0.3, green.f=0.3, blue.f=0.3) boxplotdou(iris[c(5,1)], iris[c(5,2)], COLOR.SHEER=mysheer) # whisker boxplotdou(iris[c(5,1)], iris[c(5,2)], boxed.whiskers=TRUE) boxplotdou(iris[c(5,1)], iris[c(5,2)], outliers.has.whiskers=TRUE) # condense boxplotdou(iris[c(5,1)], iris[c(5,2)], condense=TRUE) # labels boxplotdou(iris[c(5,1)], iris[c(5,2)], factor.labels=FALSE) boxplotdou(iris[c(5,1)], iris[c(5,2)], factor.labels=TRUE) boxplotdou(iris[c(5,1)], iris[c(5,2)], factor.labels=TRUE, draw.legend=FALSE) boxplotdou(iris[c(5,1)], iris[c(5,2)], factor.labels=c('Se','Ve','Vi')) boxplotdou(iris[c(5,1)], iris[c(5,2)], factor.labels='+', name.on.axis=FALSE) # customized summary function mystat <- function(x) boxplot(formula=x, range=1, plot=FALSE) boxplotdou(iris[c(5,1)], iris[c(5,2)], STAT=mystat) # graphic parameters boxplotdou(iris[c(5,1)], iris[c(5,2)], xlim=c(4.8, 7.0), ylim=c(2.0, 3.5)) # print summary boxplotdou(iris[c(5,1)], iris[c(5,2)], plot=FALSE)