Title: | Ellipse Summary Plot of Quantiles |
---|---|
Description: | Correlation chart of two set (x and y) of data. Using Quantiles. Visualize the effect of factor. |
Authors: | Shinichiro Tomizono |
Maintainer: | Shinichiro Tomizono <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.3.0 |
Built: | 2024-11-21 05:05:01 UTC |
Source: | https://github.com/cran/elliplot |
Correlation chart of two set (x and y) of data. Using Quantiles. Visualize the effect of factor.
The DESCRIPTION file:
Package: | elliplot |
Type: | Package |
Title: | Ellipse Summary Plot of Quantiles |
Version: | 1.3.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 Quantiles. Visualize the effect of factor. |
Depends: | methods |
License: | MIT + file LICENSE |
NeedsCompilation: | no |
Packaged: | 2022-04-19 09:27:49 UTC; nara |
Date/Publication: | 2022-04-19 10:32:30 UTC |
Repository: | https://osubera.r-universe.dev |
RemoteUrl: | https://github.com/cran/elliplot |
RemoteRef: | HEAD |
RemoteSha: | 4866fa12a7e5b6a879fbdf968923ae6c3ac878fb |
Index of help topics:
elliplot-package Ellipse Summary Plot of Quantiles ellipseplot Draw Ellipse Summary Plot midpoint Center of Indexes midpoints Quantile Summaries ninenum Nine Number Summaries seventeennum Seventeen Number Summaries
This package contains quantile functions and ellipse plot functions. These functions are to calculate quantile summaries and visualize them with ellipses.
The ellipseplot works both for 1 set and 2 sets of data. When used for 2 sets data, it visualize the correlation of x and y axis.
Shinichiro Tomizono
Maintainer: Shinichiro Tomizono <[email protected]>
Quantiles: https://tomizonor.wordpress.com/2013/04/28/quantiles-octiles/
Ellipse Plot: https://tomizonor.wordpress.com/2013/04/29/ellipse-plot/
ninenum(1:999) ellipseplot(iris[c(5,1)], iris[c(5,2)])
ninenum(1:999) ellipseplot(iris[c(5,1)], iris[c(5,2)])
Correlation chart of two set (x and y) of data. Using Quantiles. Visualize the effect of factor.
ellipseplot(x, ...) ## Default S3 method: ellipseplot(x, y=NULL, SUMMARY=ninenum, SHEER=sheer.color, plot=TRUE, verbose=FALSE, ...)
ellipseplot(x, ...) ## Default S3 method: ellipseplot(x, y=NULL, SUMMARY=ninenum, SHEER=sheer.color, plot=TRUE, verbose=FALSE, ...)
x |
An x-axis data, such as data frame of factors (1st column) and observations (2nd column). A vector, a matrix or a list is also acceptable. If a vector is given, a single ellipse without factors are drawn. A matrix is as same format as the data frame. A list is formed by factors with observatoin vectors as each item. |
y |
A y-axis data, such as data frame of factors (1st column) and observations (2nd column). Same types as the x-axis data are also acceptable. It can be a NULL (default), to draw a single axis chart. |
SUMMARY |
A function generating quantile summaries to write contours of ellipses. The default is ninenum to use nine number summary. The function must return an odd length numerical vector, because a center, such as median, is required. |
SHEER |
A function adjusting color levels of ellipses. The default is sheer.color function shown below. sheer.color <- function(col, level) { sheer <- level^2 * 0.5 adjustcolor(col, alpha.f=sheer) } |
plot |
If FALSE is given, it disable to plot and print a summary. The default is TRUE. |
verbose |
If TRUE is given, it print verbose debugging information. The default is FALSE. |
... |
Plot 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.
A summary list is explicitly printed when plot=FALSE is given, and is invisibly returned when plot=TRUE.
Shinichiro Tomizono
Ellipse Summary Plot https://tomizonor.wordpress.com/2013/04/29/ellipse-plot/
ninenum
,
seventeennum
,
midpoints
.
# iris data: Sepal.Length v.s. Sepal.Width by Species ellipseplot(iris[c(5,1)], iris[c(5,2)]) # PlantGrowth data: weight by group : single axis # five number summaries are used. # similar to boxplot(weight~group,PlantGrowth) ellipseplot(PlantGrowth[2:1], SUMMARY=fivenum) # iris data: Sepal.Length v.s. Sepal.Width without factor ellipseplot(iris[,1], iris[,2], xlab='Sepal.Length', ylab='Sepal.Width') # list example ellipseplot(list(untreated=rnorm(30,3,1), treated=rnorm(30,5,2)), list(untreated=rnorm(20,6,3), treated=rnorm(20,4,2))) # using cutomized sheer function my.sheer.color <- function(col, level) adjustcolor(rainbow(100)[runif(1,1,100)], alpha.f=0.4) ellipseplot(iris[c(5,1)], iris[c(5,2)], SHEER=my.sheer.color)
# iris data: Sepal.Length v.s. Sepal.Width by Species ellipseplot(iris[c(5,1)], iris[c(5,2)]) # PlantGrowth data: weight by group : single axis # five number summaries are used. # similar to boxplot(weight~group,PlantGrowth) ellipseplot(PlantGrowth[2:1], SUMMARY=fivenum) # iris data: Sepal.Length v.s. Sepal.Width without factor ellipseplot(iris[,1], iris[,2], xlab='Sepal.Length', ylab='Sepal.Width') # list example ellipseplot(list(untreated=rnorm(30,3,1), treated=rnorm(30,5,2)), list(untreated=rnorm(20,6,3), treated=rnorm(20,4,2))) # using cutomized sheer function my.sheer.color <- function(col, level) adjustcolor(rainbow(100)[runif(1,1,100)], alpha.f=0.4) ellipseplot(iris[c(5,1)], iris[c(5,2)], SHEER=my.sheer.color)
Divide a given range of index into two of exact halves.
midpoint(x)
midpoint(x)
x |
range of index. |
This function implements the concept of median
,
and is used in the midpoints
to calculate
quantiles.
A list of two numeric vectors is returned.
[[1]] |
a range of index for the lower half |
[[2]] |
a range of index for the higher half |
Lengths of the two halves are exactly same. If the parent range has an odd length, the exact center index is used both at the end of the lower half and at the start of the higher half.
Shinichiro Tomizono
Quantiles: median, quartiles, octiles, hexadeciles, ... https://tomizonor.wordpress.com/2013/04/28/quantiles-octiles/
midpoint(c(2,8)) # results are shown below. # [[1]] # [1] 2 5 # # [[2]] # [1] 5 8 midpoint(c(2,9)) # results are shown below. # [[1]] # [1] 2 5 # # [[2]] # [1] 6 9
midpoint(c(2,8)) # results are shown below. # [[1]] # [1] 2 5 # # [[2]] # [1] 5 8 midpoint(c(2,9)) # results are shown below. # [[1]] # [1] 2 5 # # [[2]] # [1] 6 9
Return quantile summary (minimum, quantiles, maximum) for the input data.
midpoints(x, n = 1, na.rm = TRUE)
midpoints(x, n = 1, na.rm = TRUE)
x |
numeric, maybe including |
n |
positive integer, to determine which quantiles to calculate.
return values are |
na.rm |
logical value indicating whether |
This function is calling midpoint
with n
depth.
A numeric vector of length containing the summary information.
Shinichiro Tomizono
Quantiles: median, quartiles, octiles, hexadeciles, ... https://tomizonor.wordpress.com/2013/04/28/quantiles-octiles/
midpoint
,
seventeennum
,
ninenum
,
fivenum
,
median
.
midpoints(1:100, 4) midpoints(c(rnorm(100), -Inf, Inf), 3) # define 33 number summary thirtythreenum <- function(x, ...) midpoints(x, 5, ...) thirtythreenum(1:100)
midpoints(1:100, 4) midpoints(c(rnorm(100), -Inf, Inf), 3) # define 33 number summary thirtythreenum <- function(x, ...) midpoints(x, 5, ...) thirtythreenum(1:100)
Return nine number summary (minimum, 1st-3rd octiles, median, 5th-7th octiles, maximum) for the input data.
ninenum(x, na.rm=TRUE)
ninenum(x, na.rm=TRUE)
x |
numeric, maybe including |
na.rm |
logical value indicating whether |
This function is similar to fivenum
. This returns octiles instead of quartiles of the fivenum
.
A numeric vector of length 9 containing the summary information.
Internally calling midpoints
with n=3
.
Shinichiro Tomizono
Quantiles: median, quartiles, octiles, hexadeciles, ... https://tomizonor.wordpress.com/2013/04/28/quantiles-octiles/
midpoints
,
seventeennum
,
fivenum
,
median
.
ninenum(1:100) ninenum(c(rnorm(100), -Inf, Inf))
ninenum(1:100) ninenum(c(rnorm(100), -Inf, Inf))
Return seventeen number summary (minimum, 1st-7th hexadeciles, median, 9th-15th hexadeciles, maximum) for the input data.
seventeennum(x, na.rm=TRUE)
seventeennum(x, na.rm=TRUE)
x |
numeric, maybe including |
na.rm |
logical value indicating whether |
This function is similar to fivenum
. This returns hexadeciles instead of quartiles of the fivenum
.
A numeric vector of length 17 containing the summary information.
Internally calling midpoints
with n=4
.
Shinichiro Tomizono
Quantiles: median, quartiles, octiles, hexadeciles, ... https://tomizonor.wordpress.com/2013/04/28/quantiles-octiles/
midpoints
,
ninenum
,
fivenum
,
median
.
seventeennum(1:100) seventeennum(c(rnorm(100), -Inf, Inf))
seventeennum(1:100) seventeennum(c(rnorm(100), -Inf, Inf))