| Title: | Visualizing Interval-Valued Data Using 'ggplot2' |
|---|---|
| Description: | Extends 'ggplot2' for visualizing interval-valued data with scatter plots, histograms, index plots, boxplots, radar plots, PCA displays, and correlation heatmaps. The package also converts classical data tables into interval-valued data using clustering algorithms or user-defined groupings. |
| Authors: | Bo-Syue Jiang [aut], Han-Ming Wu [cre] |
| Maintainer: | Han-Ming Wu <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.2.5 |
| Built: | 2026-05-28 06:41:36 UTC |
| Source: | https://github.com/hanmingwu1103/gginterval |
abalone.i interval data example.
data(abalone.i)data(abalone.i)
An object of class data.frame (inherits from symbolic_tbl) with 24 rows and 7 columns.
Adapted from MAINT.Data::AbaloneIdt; the underlying
Abalone data are from the UCI Machine Learning Repository.
data(abalone.i) ggInterval_indexplot(abalone.i, aes(x = Length))data(abalone.i) ggInterval_indexplot(abalone.i, aes(x = Length))
blood.i interval data example.
data(blood.i)data(blood.i)
An object of class tbl_df (inherits from tbl, data.frame, symbolic_tbl) with 14 rows and 3 columns.
Adapted from HistDAWass::BLOOD; see
https://CRAN.R-project.org/package=HistDAWass.
Billard, Lynne and Diday, Edwin (2006). Symbolic Data Analysis: Conceptual Statistics and Data Mining. Chichester, UK: John Wiley and Sons.
data(blood.i) ggInterval_MMplot(blood.i, aes(x = Hematocrit))data(blood.i) ggInterval_MMplot(blood.i, aes(x = Hematocrit))
Cardiological interval data example.
data(Cardiological)data(Cardiological)
An object of class symbolic_tbl (inherits from tbl_df, tbl, data.frame) with 11 rows and 3 columns.
Adapted from RSDA::Cardiological; see
https://CRAN.R-project.org/package=RSDA.
Billard, Lynne and Diday, Edwin (2006). Symbolic Data Analysis: Conceptual Statistics and Data Mining. Chichester, UK: John Wiley and Sons.
data(Cardiological) ggInterval_indexplot(Cardiological, aes(x = Syst))data(Cardiological) ggInterval_indexplot(Cardiological, aes(x = Syst))
Cardiological interval data example.
data(Cardiological2)data(Cardiological2)
An object of class symbolic_tbl (inherits from tbl_df, tbl, data.frame) with 15 rows and 3 columns.
Adapted from RSDA::Cardiological2; see
https://CRAN.R-project.org/package=RSDA.
Billard, Lynne and Diday, Edwin (2006). Symbolic Data Analysis: Conceptual Statistics and Data Mining. Chichester, UK: John Wiley and Sons.
data(Cardiological2) ggInterval_indexplot(Cardiological2, aes(x = Syst))data(Cardiological2) ggInterval_indexplot(Cardiological2, aes(x = Syst))
A function for converting a classical data, which may present as a data frame or a matrix with one entry one value, into a symbolic data object, which is represented as an interval or a set in an entry. Object after converting is ggInterval class containing interval data and raw data(if it exist) and typically statistics.
classic2sym(data=NULL,groupby = "kmeans",k=5,minData=NULL,maxData=NULL, modalData = NULL)classic2sym(data=NULL,groupby = "kmeans",k=5,minData=NULL,maxData=NULL, modalData = NULL)
data |
A classical data frame that you want to be converted into interval-valued data |
groupby |
A way to aggregate. It can be either a clustering method or a variable name which exist in input data (necessary factor type) . Default "kmeans". |
k |
A number of group,which is used by clustering. Default k = 5. |
minData |
if choose groupby parameter as 'customize',user need to define which data is min data or max data. |
maxData |
if choose groupby parameter as 'customize',user need to define which data is min data or max data. |
modalData |
list, each cell of list contain a set of column index of its modal multi-valued data of the input data. the value of it is a proportion presentation, and sum of each row in these column must be equal to 1. ex 0,1,0 or 0.2,0.3,0.5. the input type of modalData for example is modalData[[1]] = c(2, 3), modalData[[2]] = c(7:10), that 2, 3, 7, 8, 9, 10 columns are modal type of the data. Note: the option is only valid when groupby == "customize". |
classic2sym returns an object of class "ggInterval",which has interval-valued data and related outputs as follows.
intervalData - The Interval data after converting also known as a RSDA object.
rawData - Classical data that user input.
clusterResult - Cluster results .If the groupby method is a clustering method then it will exist.
statisticsDF - A list contains data frame including some typically statistics in each group.
#classical data to symbolic data classic2sym(iris) classic2sym(mtcars, groupby = "kmeans", k = 10) classic2sym(iris, groupby = "hclust", k = 7) classic2sym(iris, groupby = "Species") x1<-runif(10, -30, -10) y1<-runif(10, -10, 30) x2<-runif(10, -5, 5) y2<-runif(10, 10, 50) x3<-runif(10, -50, 30) y3<-runif(10, 31, 60) d<-data.frame(min1=x1,max1=y1,min2=x2,max2=y2,min3=x3,max3=y3) classic2sym(d,groupby="customize",minData=d[,c(1,3,5)],maxData=d[,c(2,4,6)]) classic2sym(d,groupby="customize",minData=d$min1,maxData=d$min2) #example for build modal data #for the first modal data proportion a1 <- runif(10, 0,0.4) %>% round(digits = 1) a2 <- runif(10, 0,0.4) %>% round(digits = 1) #for the second modal data proportion b1 <- runif(10, 0,0.4) %>% round(digits = 1) b2 <- runif(10, 0,0.4) %>% round(digits = 1) #for interval-valued data c1 <- runif(10, 10, 20) %>% round(digits = 0) c2 <- runif(10, -50, -10) %>% round(digits = 0) #build simulated data d <- data.frame(a1 = a1, a2 = a2, a3 = 1-(a1+a2), c1 = c1, c2 = c2, b1 = b1, b2 = b2, b3 = 1-(b1+b2)) #transformation classic2sym(d, groupby = "customize", minData = d$c2, maxData = d$c1, modalData = list(1:3, 6:8))#two modal data #extract the data symObj<-classic2sym(iris) symObj$intervalData #interval data symObj$rawData #raw data symObj$clusterResult #cluster result symObj$statisticsDF #statistics#classical data to symbolic data classic2sym(iris) classic2sym(mtcars, groupby = "kmeans", k = 10) classic2sym(iris, groupby = "hclust", k = 7) classic2sym(iris, groupby = "Species") x1<-runif(10, -30, -10) y1<-runif(10, -10, 30) x2<-runif(10, -5, 5) y2<-runif(10, 10, 50) x3<-runif(10, -50, 30) y3<-runif(10, 31, 60) d<-data.frame(min1=x1,max1=y1,min2=x2,max2=y2,min3=x3,max3=y3) classic2sym(d,groupby="customize",minData=d[,c(1,3,5)],maxData=d[,c(2,4,6)]) classic2sym(d,groupby="customize",minData=d$min1,maxData=d$min2) #example for build modal data #for the first modal data proportion a1 <- runif(10, 0,0.4) %>% round(digits = 1) a2 <- runif(10, 0,0.4) %>% round(digits = 1) #for the second modal data proportion b1 <- runif(10, 0,0.4) %>% round(digits = 1) b2 <- runif(10, 0,0.4) %>% round(digits = 1) #for interval-valued data c1 <- runif(10, 10, 20) %>% round(digits = 0) c2 <- runif(10, -50, -10) %>% round(digits = 0) #build simulated data d <- data.frame(a1 = a1, a2 = a2, a3 = 1-(a1+a2), c1 = c1, c2 = c2, b1 = b1, b2 = b2, b3 = 1-(b1+b2)) #transformation classic2sym(d, groupby = "customize", minData = d$c2, maxData = d$c1, modalData = list(1:3, 6:8))#two modal data #extract the data symObj<-classic2sym(iris) symObj$intervalData #interval data symObj$rawData #raw data symObj$clusterResult #cluster result symObj$statisticsDF #statistics
This function compute the symbolic correlation
cor(x, ...) ## Default S3 method: cor( x, y = NULL, use = "everything", method = c("pearson", "kendall", "spearman"), ... ) ## S3 method for class 'symbolic_tbl' cor(x, ...) ## S3 method for class 'symbolic_interval' cor(x, y, method = c("centers", "B", "BD", "BG"), ...)cor(x, ...) ## Default S3 method: cor( x, y = NULL, use = "everything", method = c("pearson", "kendall", "spearman"), ... ) ## S3 method for class 'symbolic_tbl' cor(x, ...) ## S3 method for class 'symbolic_interval' cor(x, y, method = c("centers", "B", "BD", "BG"), ...)
x |
First symbolic variables. |
... |
As in R cor function. |
y |
Second symbolic variables. |
use |
an optional character string giving a method for computing correlation in the presence of missing values. This must be (an abbreviation of) one of the strings 'everything', 'all.obs', 'complete.obs', 'na.or.complete', or 'pairwise.complete.obs'. |
method |
The method to use. |
Supported interval-valued methods are:
"centers": correlation of interval centers.
"B": Billard correlation.
"BD": Billard-Diday correlation.
"BG": Bertrand-Goupil correlation.
For "B", "BD", and "BG", the denominator uses the
corresponding method-matched standard deviation.
Return a real number in [-1, 1].
Bertrand, Patrice and Goupil, Francoise (2000). Descriptive Statistics for Symbolic Data. In Hans-Hermann Bock and Edwin Diday (eds.), Analysis of Symbolic Data, pp. 106–124. Berlin and Heidelberg: Springer.
Billard, Lynne and Diday, Edwin (2006). Symbolic Data Analysis: Conceptual Statistics and Data Mining. Chichester, UK: John Wiley and Sons.
Billard, Lynne (2008). Sample covariance functions for complex quantitative data. In Proceedings of the World IASC Conference, pp. 157–163, Yokohama, Japan.
Rodriguez-Rojas, Oldemar (2000). Classification et modeles lineaires en analyse des donnees symboliques. PhD thesis, Universite Paris IX Dauphine.
This function compute the symbolic covariance.
cov(x, ...) ## Default S3 method: cov( x, y = NULL, use = "everything", method = c("pearson", "kendall", "spearman"), ... ) ## S3 method for class 'symbolic_tbl' cov(x, ...) ## S3 method for class 'symbolic_interval' cov(x, y = NULL, method = c("centers", "B", "BD", "BG"), na.rm = FALSE, ...)cov(x, ...) ## Default S3 method: cov( x, y = NULL, use = "everything", method = c("pearson", "kendall", "spearman"), ... ) ## S3 method for class 'symbolic_tbl' cov(x, ...) ## S3 method for class 'symbolic_interval' cov(x, y = NULL, method = c("centers", "B", "BD", "BG"), na.rm = FALSE, ...)
x |
First symbolic variables. |
... |
As in R cov function. |
y |
Second symbolic variables. |
use |
an optional character string giving a method for computing covariances in the presence of missing values. This must be (an abbreviation of) one of the strings 'everything', 'all.obs', 'complete.obs', 'na.or.complete', or 'pairwise.complete.obs'. |
method |
The method to use. |
na.rm |
As in R cov function. |
Supported interval-valued methods are:
"centers": covariance of interval centers.
"B": Billard covariance.
"BD": Billard-Diday covariance.
"BG": Bertrand-Goupil covariance.
Return a real number.
Bertrand, Patrice and Goupil, Francoise (2000). Descriptive Statistics for Symbolic Data. In Hans-Hermann Bock and Edwin Diday (eds.), Analysis of Symbolic Data, pp. 106–124. Berlin and Heidelberg: Springer.
Billard, Lynne and Diday, Edwin (2006). Symbolic Data Analysis: Conceptual Statistics and Data Mining. Chichester, UK: John Wiley and Sons.
Billard, Lynne (2008). Sample covariance functions for complex quantitative data. In Proceedings of the World IASC Conference, pp. 157–163, Yokohama, Japan.
Rodriguez-Rojas, Oldemar (2000). Classification et modeles lineaires en analyse des donnees symboliques. PhD thesis, Universite Paris IX Dauphine.
Environment interval and modal data example.
data(Environment)data(Environment)
An object of class symbolic_tbl (inherits from tbl_df, tbl, data.frame) with 14 rows and 17 columns.
data(Environment) ggInterval_radarplot(Environment, plotPartial = 2, showLegend = FALSE, base_circle = TRUE, base_lty = 2, addText = FALSE)data(Environment) ggInterval_radarplot(Environment, plotPartial = 2, showLegend = FALSE, base_circle = TRUE, base_lty = 2, addText = FALSE)
Symbolic data matrix with all the variables of interval type.
data('facedata')data('facedata')
$I;AD;AD;$I;BC;BC;.........
HUS1;$I;168.86;172.84;$I;58.55;63.39;.........
HUS2;$I;169.85;175.03;$I;60.21;64.38;.........
HUS3;$I;168.76;175.15;$I;61.4;63.51;.........
INC1;$I;155.26;160.45;$I;53.15;60.21;.........
INC2;$I;156.26;161.31;$I;51.09;60.07;.........
INC3;$I;154.47;160.31;$I;55.08;59.03;.........
ISA1;$I;164;168;$I;55.01;60.03;.........
ISA2;$I;163;170;$I;54.04;59;.........
ISA3;$I;164.01;169.01;$I;55;59.01;.........
JPL1;$I;167.11;171.19;$I;61.03;65.01;.........
JPL2;$I;169.14;173.18;$I;60.07;65.07;.........
JPL3;$I;169.03;170.11;$I;59.01;65.01;.........
KHA1;$I;149.34;155.54;$I;54.15;59.14;.........
KHA2;$I;149.34;155.32;$I;52.04;58.22;.........
KHA3;$I;150.33;157.26;$I;52.09;60.21;.........
LOT1;$I;152.64;157.62;$I;51.35;56.22;.........
LOT2;$I;154.64;157.62;$I;52.24;56.32;.........
LOT3;$I;154.83;157.81;$I;50.36;55.23;.........
PHI1;$I;163.08;167.07;$I;66.03;68.07;.........
PHI2;$I;164;168.03;$I;65.03;68.12;.........
PHI3;$I;161.01;167;$I;64.07;69.01;.........
ROM1;$I;167.15;171.24;$I;64.07;68.07;.........
ROM2;$I;168.15;172.14;$I;63.13;68.07;.........
ROM3;$I;167.11;171.19;$I;63.13;68.03;.........
Adapted from RSDA::facedata; see
https://CRAN.R-project.org/package=RSDA.
Billard, Lynne and Diday, Edwin (2006). Symbolic Data Analysis: Conceptual Statistics and Data Mining. Chichester, UK: John Wiley and Sons.
data(facedata) ggInterval_hist(facedata, aes(x = AD))data(facedata) ggInterval_hist(facedata, aes(x = AD))
This is an object that will be used to make a ggplot object.A ggInterval object contains both classic data that user have and interval data which we transform.More over,some basic statistics from row data will also be recorded in this object,and the interval data which is from RSDA transformation will still contain RSDA properties.
rawDatathe data from user.
statisticsDFcontains min max mean median dataframe for each group of symbolic data
intervalDatainterval data from RSDA type
clusterResultclustering result
new()
initialize all data, check whether satisfy theirs form
ggInterval$new( rawData = NULL, statisticsDF = NULL, intervalData = NULL, clusterResult = NULL )
clone()
The objects of this class are cloneable with this method.
ggInterval$clone(deep = FALSE)
deepWhether to make a deep clone.
Visualize the joint distribution of two continuous interval-valued variables by dividing the x axis and y axis into rectangles and calculating the frequency of each observation interval in every rectangle.
ggInterval_2Dhist(data = NULL, mapping = aes(NULL), method = "equal-bin", xBins = 14, yBins = 16, display = "p", palette = "Blues", direction = 1, tau = 0, removeZero = FALSE, cell_labels = FALSE, label_rule = "above-mean", addFreq = NULL)ggInterval_2Dhist(data = NULL, mapping = aes(NULL), method = "equal-bin", xBins = 14, yBins = 16, display = "p", palette = "Blues", direction = 1, tau = 0, removeZero = FALSE, cell_labels = FALSE, label_rule = "above-mean", addFreq = NULL)
data |
A ggInterval object. It can also be either an RSDA object or a classical data frame, which will be automatically converted to ggInterval data. |
mapping |
Set of aesthetic mappings created by aes() or aes_(). If specified and inherit.aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping. It is the same as the mapping of ggplot2. |
method |
Histogram partition method. Use |
xBins |
Number of x-axis bins used when |
yBins |
Number of y-axis bins used when |
display |
Metric shown in the cells. Use |
palette |
ColorBrewer palette passed to |
direction |
Direction passed to |
tau |
Non-negative tolerance used when |
removeZero |
Whether remove data whose frequency is equal to zero. |
cell_labels |
Logical. If |
label_rule |
Rule used when |
addFreq |
Deprecated alias for |
Return a list containing a ggplot2 object and the corresponding frequency table.
ggInterval_2Dhist(oils, aes(x = GRA, y = FRE), xBins = 5, yBins = 5, display = "p", palette = "Blues", cell_labels = TRUE) ggInterval_2Dhist(oils, aes(x = GRA, y = FRE), method = "unequal-bin", display = "p", palette = "Blues", tau = 0.5)ggInterval_2Dhist(oils, aes(x = GRA, y = FRE), xBins = 5, yBins = 5, display = "p", palette = "Blues", cell_labels = TRUE) ggInterval_2Dhist(oils, aes(x = GRA, y = FRE), method = "unequal-bin", display = "p", palette = "Blues", tau = 0.5)
Visualize all continuous interval-valued variables with a matrix of 2D histograms. Each off-diagonal panel shows a 2D histogram for a pair of variables, and each diagonal panel displays the variable name.
ggInterval_2DhistMatrix(data = NULL, mapping = aes(NULL), method = "equal-bin", xBins = 8, yBins = 8, display = "p", palette = "Blues", direction = 1, tau = 0, removeZero = FALSE, cell_labels = FALSE, label_rule = "above-mean", addFreq = NULL)ggInterval_2DhistMatrix(data = NULL, mapping = aes(NULL), method = "equal-bin", xBins = 8, yBins = 8, display = "p", palette = "Blues", direction = 1, tau = 0, removeZero = FALSE, cell_labels = FALSE, label_rule = "above-mean", addFreq = NULL)
data |
A ggInterval object. It can also be either an RSDA object or a classical data frame, which will be automatically converted to ggInterval data. |
mapping |
Set of aesthetic mappings created by aes() or aes_().
If specified and inherit.aes = TRUE (the default), it is combined with
the default mapping at the top level of the plot. It is the same as the
mapping of ggplot2. This function ignores |
method |
Histogram partition method. Use |
xBins |
Number of x-axis bins used when |
yBins |
Number of y-axis bins used when |
display |
Metric shown in the cells. Use |
palette |
ColorBrewer palette passed to |
direction |
Direction passed to |
tau |
Non-negative tolerance used when |
removeZero |
Whether remove cells whose frequency is equal to zero. |
cell_labels |
Logical. If |
label_rule |
Rule used when |
addFreq |
Deprecated alias for |
Return a ggplot2 object.
ggInterval_2DhistMatrix( oils, xBins = 5, yBins = 5, display = "p", palette = "Blues", cell_labels = TRUE ) ggInterval_2DhistMatrix( oils, method = "unequal-bin", display = "p", palette = "Blues", tau = 0.5 )ggInterval_2DhistMatrix( oils, xBins = 5, yBins = 5, display = "p", palette = "Blues", cell_labels = TRUE ) ggInterval_2DhistMatrix( oils, method = "unequal-bin", display = "p", palette = "Blues", tau = 0.5 )
Visualize the three continuous variable distribution by collecting all vertices in each interval to form a shape of cube.Also show the difference between each group.
ggInterval_3Dscatterplot(data = NULL,mapping = aes(NULL),scale=FALSE)ggInterval_3Dscatterplot(data = NULL,mapping = aes(NULL),scale=FALSE)
data |
A ggInterval object. It can also be either an RSDA object or a classical data frame, which will be automatically converted to ggInterval data. |
mapping |
Set of aesthetic mappings created by aes() or aes_(). If specified and inherit. aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping. It is the same as the mapping of ggplot2. |
scale |
A boolean variable. |
Return a ggplot2 object (It will still be 2-Dimension).
ggInterval_3Dscatterplot(facedata[1:5, ], aes(x = BC, y = EH, z = GH))ggInterval_3Dscatterplot(facedata[1:5, ], aes(x = BC, y = EH, z = GH))
Visualize the one continuous variable distribution using one of three interval-aware boxplot styles.
ggInterval_boxplot(data = NULL,mapping = aes(NULL),plotAll=FALSE, width_type = "violin-like")ggInterval_boxplot(data = NULL,mapping = aes(NULL),plotAll=FALSE, width_type = "violin-like")
data |
A ggInterval object. It can also be either RSDA object or classical data frame, which will be automatically convert to ggInterval data. |
mapping |
Set of aesthetic mappings created by aes() or aes_(). If specified and inherit. aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping. It is the same as the mapping of ggplot2. |
plotAll |
booleans, if TRUE, plot all variable together |
width_type |
Box-width style. Use |
Return a ggplot2 object.
mydata <- ggInterval::facedata ggInterval_boxplot(mydata, aes(x = AD)) ggInterval_boxplot(mydata, aes(x = AD), width_type = "quantile-depth") ggInterval_boxplot(mydata, plotAll = TRUE, width_type = "side-by-side")mydata <- ggInterval::facedata ggInterval_boxplot(mydata, aes(x = AD)) ggInterval_boxplot(mydata, aes(x = AD), width_type = "quantile-depth") ggInterval_boxplot(mydata, plotAll = TRUE, width_type = "side-by-side")
Visualize pairwise symbolic correlations between interval-valued variables with a heatmap. This plot is especially useful for summarizing multivariate dependence structures before more formal modeling or dimension reduction.
ggInterval_corrplot( data = NULL, method = c("centers", "B", "BD", "BG"), triangle = c("lower", "upper", "full"), showValues = TRUE, digits = 2, showLegend = TRUE )ggInterval_corrplot( data = NULL, method = c("centers", "B", "BD", "BG"), triangle = c("lower", "upper", "full"), showValues = TRUE, digits = 2, showLegend = TRUE )
data |
A ggInterval object. It can also be either an RSDA object or a classical data frame, which will be automatically converted to ggInterval data. |
method |
Correlation method for interval-valued variables. It must be
one of |
triangle |
Which part of the symmetric correlation matrix to display.
It can be |
showValues |
Logical. If |
digits |
Number of digits used when |
showLegend |
Logical. If |
Return a ggplot2 object.
Bertrand, Patrice and Goupil, Francoise (2000). Descriptive Statistics for Symbolic Data. In Hans-Hermann Bock and Edwin Diday (eds.), Analysis of Symbolic Data, pp. 106–124. Berlin and Heidelberg: Springer.
Billard, Lynne and Diday, Edwin (2006). Symbolic Data Analysis: Conceptual Statistics and Data Mining. Chichester, UK: John Wiley and Sons.
Billard, Lynne (2008). Sample covariance functions for complex quantitative data. In Proceedings of the World IASC Conference, pp. 157–163, Yokohama, Japan.
ggInterval_corrplot(facedata) ggInterval_corrplot(facedata, method = "BG", triangle = "full")ggInterval_corrplot(facedata) ggInterval_corrplot(facedata, method = "BG", triangle = "full")
Visualize the relation between interval centers and ranges, with mean reference lines and an optional ellipse overlay.
ggInterval_CRplot(data = NULL,mapping = aes(NULL),plotAll=FALSE, addEllipse = TRUE, ellipseFill = "blue", ellipseAlpha = 0.3)ggInterval_CRplot(data = NULL,mapping = aes(NULL),plotAll=FALSE, addEllipse = TRUE, ellipseFill = "blue", ellipseAlpha = 0.3)
data |
A ggInterval object. It can also be either RSDA object or classical data frame,which will be automatically convert to ggInterval data. |
mapping |
Set of aesthetic mappings created by aes() or aes_(). If specified and inherit. aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping. It is the same as the mapping of ggplot2. |
plotAll |
booleans, if TRUE, plot all variable together |
addEllipse |
logical, if TRUE (default), add a shaded ellipse layer. |
ellipseFill |
fill color of the ellipse layer. Default is "blue". |
ellipseAlpha |
alpha level of the ellipse layer. Default is 0.3. |
Return a ggplot2 object.
mydata <- ggInterval::facedata ggInterval_CRplot(mydata, aes(x = AD, col = "blue", shape = 2)) ggInterval_CRplot(mydata, plotAll = TRUE) ggInterval_CRplot(mydata, plotAll = TRUE, addEllipse = FALSE)mydata <- ggInterval::facedata ggInterval_CRplot(mydata, aes(x = AD, col = "blue", shape = 2)) ggInterval_CRplot(mydata, plotAll = TRUE) ggInterval_CRplot(mydata, plotAll = TRUE, addEllipse = FALSE)
Visualize the continuous variable distribution by dividing the x axis into bins,and calculating the frequency of observation interval in each bin.
ggInterval_hist(data = NULL,mapping = aes(NULL),method="equal-bin",bins=10, plotAll = FALSE, position = "identity", alpha = 0.5)ggInterval_hist(data = NULL,mapping = aes(NULL),method="equal-bin",bins=10, plotAll = FALSE, position = "identity", alpha = 0.5)
data |
A ggInterval object.It can also be either RSDA object or classical data frame,which will be automatically convert to ggInterval data. |
mapping |
Set of aesthetic mappings created by aes() or aes_(). If specified and inherit. aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping. It is the same as the mapping of ggplot2. |
method |
It can be |
bins |
x axis bins,which mean how many partials the variable |
plotAll |
boolean, whether plot all variables, default FALSE. will be separate into. |
position |
"stack" or "identity" |
alpha |
fill alpha |
An object of class ggInterval_hist_result. A direct call
displays the histogram, and the returned object stores the ggplot object in
$plot together with the accompanying frequency tables.
mydata <- ggInterval::facedata ggInterval_hist(mydata, aes(x = AD), bins = 10) hist_obj <- ggInterval_hist(mydata, plotAll = TRUE, bins = 10) hist_obj hist_obj$`Table AD` ggInterval_hist(mydata, aes(x = AD), method = "unequal-bin")mydata <- ggInterval::facedata ggInterval_hist(mydata, aes(x = AD), bins = 10) hist_obj <- ggInterval_hist(mydata, plotAll = TRUE, bins = 10) hist_obj hist_obj$`Table AD` ggInterval_hist(mydata, aes(x = AD), method = "unequal-bin")
Visualize interval-valued observations with color strips.
For a single variable, the display acts as a color-based analogue of an
index plot. When plotAll = TRUE, the function produces a
multivariate image plot across all continuous interval-valued variables.
ggInterval_indexImage(data = NULL, mapping = aes(NULL), column_condition = TRUE, full_strip = FALSE, plotAll = FALSE)ggInterval_indexImage(data = NULL, mapping = aes(NULL), column_condition = TRUE, full_strip = FALSE, plotAll = FALSE)
data |
A ggInterval object. It can also be either RSDA object or classical data frame,which will be automatically convert to ggInterval data. |
mapping |
Set of aesthetic mappings created by aes() or aes_(). If specified and inherit. aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping. |
column_condition |
Logical. If |
full_strip |
Logical. If |
plotAll |
Logical. If |
Return a ggplot2 object.
mydata <- ggInterval::facedata p <- ggInterval_indexImage(mydata, aes(x = AD), full_strip = TRUE, column_condition = TRUE) # Recommend adding coord_flip() to make the single-variable display clearer. p + coord_flip() ggInterval_indexImage( mydata, plotAll = TRUE, full_strip = TRUE, column_condition = FALSE ) + scale_colour_distiller(palette = "Blues", direction = 1) ggInterval_indexImage(mydata, plotAll = TRUE, full_strip = FALSE)mydata <- ggInterval::facedata p <- ggInterval_indexImage(mydata, aes(x = AD), full_strip = TRUE, column_condition = TRUE) # Recommend adding coord_flip() to make the single-variable display clearer. p + coord_flip() ggInterval_indexImage( mydata, plotAll = TRUE, full_strip = TRUE, column_condition = FALSE ) + scale_colour_distiller(palette = "Blues", direction = 1) ggInterval_indexImage(mydata, plotAll = TRUE, full_strip = FALSE)
Visualize the range of the variables of each observations by using a kind of margin bar that indicate the minimal and maximal of observations.
ggInterval_indexplot(data = NULL,mapping = aes(NULL), plotAll = FALSE, row_order = "o", user_order = NULL, labels = FALSE)ggInterval_indexplot(data = NULL,mapping = aes(NULL), plotAll = FALSE, row_order = "o", user_order = NULL, labels = FALSE)
data |
A ggInterval object. It can also be either RSDA object or classical data frame,which will be automatically convert to ggInterval data. |
mapping |
Set of aesthetic mappings created by aes() or aes_(). If specified and inherit. aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping. It is the same as the mapping of ggplot2. |
plotAll |
plot all variables |
row_order |
Row ordering used when |
user_order |
User-defined row permutation used when
|
labels |
Logical. When |
Return a ggplot2 object.
mydata <- ggInterval::facedata Subjects <- substr(rownames(mydata), 1, 3) ggInterval_indexplot(mydata, aes(x = AD)) ggInterval_indexplot(mydata, aes(x = AD, fill = Subjects)) ggInterval_indexplot(mydata, plotAll = TRUE, row_order = "c") custom_order <- c(19:21, 22:24, 1:18, 25:27) ggInterval_indexplot(mydata["AD"], plotAll = TRUE, row_order = "u", user_order = custom_order) ggInterval_indexplot(mydata, plotAll = TRUE, row_order = "c", labels = TRUE)mydata <- ggInterval::facedata Subjects <- substr(rownames(mydata), 1, 3) ggInterval_indexplot(mydata, aes(x = AD)) ggInterval_indexplot(mydata, aes(x = AD, fill = Subjects)) ggInterval_indexplot(mydata, plotAll = TRUE, row_order = "c") custom_order <- c(19:21, 22:24, 1:18, 25:27) ggInterval_indexplot(mydata["AD"], plotAll = TRUE, row_order = "u", user_order = custom_order) ggInterval_indexplot(mydata, plotAll = TRUE, row_order = "c", labels = TRUE)
Visualize interval-valued data along an ordered horizontal axis. A line can connect the centers of intervals at each position, with crossbars or errorbars indicating the interval range. When the horizontal axis is time, the display becomes an interval-valued time-series plot.
ggInterval_lineplot(data = NULL, mapping = aes(NULL), barWidth = 0.5, add_line = TRUE) ggInterval_tsplot(data = NULL, mapping = aes(NULL), barWidth = 0.5, add_line = TRUE)ggInterval_lineplot(data = NULL, mapping = aes(NULL), barWidth = 0.5, add_line = TRUE) ggInterval_tsplot(data = NULL, mapping = aes(NULL), barWidth = 0.5, add_line = TRUE)
data |
A ggInterval object. It can also be either RSDA object or classical data frame, which will be automatically convert to ggInterval data. |
mapping |
Set of aesthetic mappings created by aes() or aes_(). Must include x for the ordered variable and y for the interval variable. Optional aesthetics include group and fill for multiple line series. It is the same as the mapping of ggplot2. |
barWidth |
The width of the crossbar or errorbar indicating the interval range at each x position. Default is 0.5. |
add_line |
Logical; if TRUE (default), connect interval centers with a
line. Set FALSE when adding a customized line layer with
|
Return a ggplot2 object.
if (requireNamespace("TTR", quietly = TRUE)) { data("ttrc", package = "TTR") stock.data <- subset( ttrc[, c("Date", "Close", "Low", "High")], format(Date, "%Y-%m") %in% c("1985-01", "1985-02", "1985-03") ) stock.data$Month <- factor( month.abb[as.integer(format(stock.data$Date, "%m"))], levels = month.abb[1:3] ) stock.data$Day <- as.integer(format(stock.data$Date, "%d")) stock.i <- classic2sym( stock.data, groupby = "customize", minData = stock.data$Low, maxData = stock.data$High ) ggInterval_lineplot(stock.i, aes(y = V1, x = Day), barWidth = 0.6) + geom_point(aes(y = Close), shape = 21, fill = "#D95F02", color = "black", size = 1.6, stroke = 0.2) + coord_cartesian(xlim = c(1, 31), expand = FALSE) + facet_wrap(~Month, ncol = 1, scales = "free_y") + scale_x_continuous(breaks = c(1, 8, 15, 22, 29)) + labs(x = "Day of month", y = "Price") + ggthemes::theme_economist() + theme(strip.text = element_text(face = "bold")) }if (requireNamespace("TTR", quietly = TRUE)) { data("ttrc", package = "TTR") stock.data <- subset( ttrc[, c("Date", "Close", "Low", "High")], format(Date, "%Y-%m") %in% c("1985-01", "1985-02", "1985-03") ) stock.data$Month <- factor( month.abb[as.integer(format(stock.data$Date, "%m"))], levels = month.abb[1:3] ) stock.data$Day <- as.integer(format(stock.data$Date, "%d")) stock.i <- classic2sym( stock.data, groupby = "customize", minData = stock.data$Low, maxData = stock.data$High ) ggInterval_lineplot(stock.i, aes(y = V1, x = Day), barWidth = 0.6) + geom_point(aes(y = Close), shape = 21, fill = "#D95F02", color = "black", size = 1.6, stroke = 0.2) + coord_cartesian(xlim = c(1, 31), expand = FALSE) + facet_wrap(~Month, ncol = 1, scales = "free_y") + scale_x_continuous(breaks = c(1, 8, 15, 22, 29)) + labs(x = "Day of month", y = "Price") + ggthemes::theme_economist() + theme(strip.text = element_text(face = "bold")) }
Visualize the range of the variables of each observations by marking minimal and maximal point.
ggInterval_MMplot(data = NULL,mapping = aes(NULL), scaleXY = "local",plotAll=FALSE)ggInterval_MMplot(data = NULL,mapping = aes(NULL), scaleXY = "local",plotAll=FALSE)
data |
A ggInterval object. It can also be either RSDA object or classical data frame,which will be automatically convert to ggInterval data. |
mapping |
Set of aesthetic mappings created by aes() or aes_(). If specified and inherit. aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping. |
scaleXY |
default "local", which means limits of x-axis and y-axis depend on their own variable. "global" means limits of them depend on all variables that user input. |
plotAll |
booleans, if TRUE, plot all variable together |
Return a ggplot2 object.
mydata <- ggInterval::facedata ggInterval_MMplot(mydata, aes(x = AD)) ggInterval_MMplot(mydata, aes(x = AD, size = 3)) ggInterval_MMplot(mydata, plotAll = TRUE, scaleXY = "global") + theme_classic()mydata <- ggInterval::facedata ggInterval_MMplot(mydata, aes(x = AD)) ggInterval_MMplot(mydata, aes(x = AD, size = 3)) ggInterval_MMplot(mydata, plotAll = TRUE, scaleXY = "global") + theme_classic()
ggInterval_PCA performs a principal components analysis on the given numeric interval data and returns the results of princomp, a ggplot object, and interval scores.
ggInterval_PCA(data = NULL,mapping = aes(NULL),plot=TRUE, concepts_group=NULL, poly = FALSE, adjust = TRUE, showLabels = TRUE, labelSize = 3, checkOverlap = FALSE)ggInterval_PCA(data = NULL,mapping = aes(NULL),plot=TRUE, concepts_group=NULL, poly = FALSE, adjust = TRUE, showLabels = TRUE, labelSize = 3, checkOverlap = FALSE)
data |
A ggInterval object. It can also be either RSDA object or classical data frame, which will be automatically convert to ggInterval data. |
mapping |
Set of aesthetic mappings created by aes() or aes_(). If specified and inherit. aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping. It is the same as the mapping of ggplot2. |
plot |
Boolean variable,Auto plot (if TRUE).It can also plot by its inner object |
concepts_group |
color with each group of concept |
poly |
if plot a poly result |
adjust |
adjust sign of the principal component |
showLabels |
Logical. If |
labelSize |
Numeric text size used when |
checkOverlap |
Logical. Passed to |
A ggplot object for PC1, PC2, and interval scores with related outputs.
scores_interval - The interval scores after PCA.
ggplotPCA - a ggplot object with x-axis and y-axis are PC1 and PC2.
others - others are the returns values of princomp.
Subjects <- substr(rownames(facedata), 1, 3) p <- ggInterval_PCA(facedata, plot = FALSE, concepts_group = Subjects) p$ggplotPCA p$scores_interval ggInterval_PCA(facedata, poly = TRUE, concepts_group = Subjects)Subjects <- substr(rownames(facedata), 1, 3) p <- ggInterval_PCA(facedata, plot = FALSE, concepts_group = Subjects) p$ggplotPCA p$scores_interval ggInterval_PCA(facedata, poly = TRUE, concepts_group = Subjects)
Visualize interval-valued and mixed symbolic data with a
radar-style display. Interval-valued variables are represented through
their lower and upper bounds, while modal multivalued variables can be
shown with stacked bars. When type = "quantile", the function
summarizes all observations of each interval-valued variable through
nested empirical quantile bands.
ggInterval_radarplot(data=NULL,layerNumber=3, inOneFig=TRUE,showLegend=TRUE,showXYLabs=FALSE, plotPartial=NULL, alpha=0.5, base_circle=TRUE, base_lty=2, addText=TRUE, type="default", quantileNum=4, Drift=0.5, addText_modal=TRUE, addText_modal.p=FALSE)ggInterval_radarplot(data=NULL,layerNumber=3, inOneFig=TRUE,showLegend=TRUE,showXYLabs=FALSE, plotPartial=NULL, alpha=0.5, base_circle=TRUE, base_lty=2, addText=TRUE, type="default", quantileNum=4, Drift=0.5, addText_modal=TRUE, addText_modal.p=FALSE)
data |
A ggInterval object. It can also be either RSDA object or classical data frame(not recommended),which will be automatically convert to ggInterval data. |
layerNumber |
Number of concentric guide layers in the radar display. |
inOneFig |
Logical. If |
showLegend |
Logical. Whether to show the legend. |
showXYLabs |
Logical. Whether to show the x- and y-axis labels. |
plotPartial |
Numeric vector giving the row indices to plot. If
|
alpha |
Alpha transparency for filled elements. |
base_circle |
Logical. If |
base_lty |
Line type used in the base figure. |
addText |
Logical. Whether to add interval-valued labels to the plot. |
type |
Radar representation. Use |
quantileNum |
Number of quantile layers when
|
Drift |
Drift term controlling where the radar values begin. |
addText_modal |
Logical. Whether to add labels for modal multivalued variables. |
addText_modal.p |
Logical. Whether to add modal percentages. |
# must specify plotPartial to the rows you want to plot Environment.n <- Environment[, 5:17] ggInterval_radarplot(Environment.n, plotPartial = 2, showLegend = FALSE, base_circle = TRUE, base_lty = 2, addText = FALSE ) + labs(title = "") + scale_fill_manual(values = c("gray50")) + scale_color_manual(values = c("red")) ggInterval_radarplot(Environment, plotPartial = 2, showLegend = FALSE, base_circle = FALSE, base_lty = 1, addText = TRUE, type = "rect" ) + labs(title = "") + scale_fill_manual(values = c("gray50")) + scale_color_manual(values = c("gray50")) ggInterval_radarplot( facedata, base_circle = FALSE, base_lty = 1, type = "quantile", quantileNum = 5, showLegend = TRUE, Drift = 0 ) + scale_fill_brewer(palette = "Greys") + labs(title = "", fill = "Quantiles")# must specify plotPartial to the rows you want to plot Environment.n <- Environment[, 5:17] ggInterval_radarplot(Environment.n, plotPartial = 2, showLegend = FALSE, base_circle = TRUE, base_lty = 2, addText = FALSE ) + labs(title = "") + scale_fill_manual(values = c("gray50")) + scale_color_manual(values = c("red")) ggInterval_radarplot(Environment, plotPartial = 2, showLegend = FALSE, base_circle = FALSE, base_lty = 1, addText = TRUE, type = "rect" ) + labs(title = "") + scale_fill_manual(values = c("gray50")) + scale_color_manual(values = c("gray50")) ggInterval_radarplot( facedata, base_circle = FALSE, base_lty = 1, type = "quantile", quantileNum = 5, showLegend = TRUE, Drift = 0 ) + scale_fill_brewer(palette = "Greys") + labs(title = "", fill = "Quantiles")
Visualize all continuous interval-valued variables with
a matrix of pairwise interval scatterplots. Each off-diagonal panel
shows interval rectangles for one variable pair, whereas each diagonal
panel displays the variable name. This function automatically filters
out non-interval variables and plots all remaining continuous interval
variables, so explicit x and y mappings are not required.
It is not recommended to apply the function to too many variables
because the full pairwise matrix becomes computationally expensive and
visually crowded.
ggInterval_scatterMatrix(data = NULL, mapping = aes(NULL), showLegend = FALSE, borderLinewidth = 0.08)ggInterval_scatterMatrix(data = NULL, mapping = aes(NULL), showLegend = FALSE, borderLinewidth = 0.08)
data |
A ggInterval object. It can also be either RSDA object or classical data frame,which will be automatically convert to ggInterval data. |
mapping |
Set of aesthetic mappings created by aes() or aes_(). If specified and inherit. aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping. |
showLegend |
whether show the legend. |
borderLinewidth |
Numeric border width used for the interval rectangles. |
Return a ggplot2 object.
mydata <- ggInterval::facedata ggInterval_scatterMatrix(mydata[, 1:3]) ggInterval_scatterMatrix( mydata[, 1:3], aes(fill = "black", alpha = 0.2), borderLinewidth = 0.15 )mydata <- ggInterval::facedata ggInterval_scatterMatrix(mydata[, 1:3]) ggInterval_scatterMatrix( mydata[, 1:3], aes(fill = "black", alpha = 0.2), borderLinewidth = 0.15 )
Visualize the distribution of two continuous interval-valued variables with rectangles whose widths and heights represent the corresponding intervals.
ggInterval_scatterplot(data = NULL,mapping = aes(NULL), showLabels = TRUE, labelSize = 3, labelPosition = "topright", labelNudgeX = 0, labelNudgeY = 0, checkOverlap = FALSE, ...)ggInterval_scatterplot(data = NULL,mapping = aes(NULL), showLabels = TRUE, labelSize = 3, labelPosition = "topright", labelNudgeX = 0, labelNudgeY = 0, checkOverlap = FALSE, ...)
data |
A ggInterval object.It can also be either RSDA object or classical data frame, which will be automatically convert to ggInterval data. |
mapping |
Set of aesthetic mappings created by aes() or aes_(). If specified and inherit. aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping. |
showLabels |
Logical. If |
labelSize |
Numeric text size used when |
labelPosition |
Character label position used when
|
labelNudgeX |
Numeric horizontal adjustment applied to label positions. |
labelNudgeY |
Numeric vertical adjustment applied to label positions. |
checkOverlap |
Logical. Passed to |
... |
Others in ggplot2. |
Return a ggplot2 object.
Subjects <- substr(rownames(facedata), 1, 3) ggInterval_scatterplot(facedata, aes(x = AD, y = BC)) ggInterval_scatterplot( facedata, aes(x = AD, y = BC, fill = Subjects), showLabels = TRUE, labelSize = 2.6, labelPosition = "topright", labelNudgeX = 0.8, labelNudgeY = 0.15, checkOverlap = TRUE, col = "black" ) p <- ggInterval_scatterplot(facedata[1:10, ], aes(x = AD, y = BC, alpha = 0.2)) p + scale_fill_manual( labels = rownames(facedata)[1:10], values = rainbow(10), name = "Group" )Subjects <- substr(rownames(facedata), 1, 3) ggInterval_scatterplot(facedata, aes(x = AD, y = BC)) ggInterval_scatterplot( facedata, aes(x = AD, y = BC, fill = Subjects), showLabels = TRUE, labelSize = 2.6, labelPosition = "topright", labelNudgeX = 0.8, labelNudgeY = 0.15, checkOverlap = TRUE, col = "black" ) p <- ggInterval_scatterplot(facedata[1:10, ], aes(x = AD, y = BC, alpha = 0.2)) p + scale_fill_manual( labels = rownames(facedata)[1:10], values = rainbow(10), name = "Group" )
iris.i interval data example.
data(iris.i)data(iris.i)
An object of class data.frame (inherits from symbolic_tbl) with 3 rows and 4 columns.
data(iris.i) ggInterval_indexplot(iris.i, aes(x = Sepal.Length))data(iris.i) ggInterval_indexplot(iris.i, aes(x = Sepal.Length))
mtcars.i interval and modal data example.
data(mtcars.i)data(mtcars.i)
An object of class symbolic_tbl (inherits from tbl_df, tbl, data.frame, symbolic_tbl) with 5 rows and 11 columns.
data(mtcars.i) ggInterval_indexplot(mtcars.i, aes(x = mpg))data(mtcars.i) ggInterval_indexplot(mtcars.i, aes(x = mpg))
mushroom interval data example.
data(mushroom)data(mushroom)
An object of class tbl_df (inherits from tbl, data.frame, symbolic_tbl) with 23 rows and 3 columns.
Adapted from RSDA::mushroom; see
https://CRAN.R-project.org/package=RSDA.
Billard, Lynne and Diday, Edwin (2006). Symbolic Data Analysis: Conceptual Statistics and Data Mining. Chichester, UK: John Wiley and Sons.
data(mushroom) ggInterval_scatterplot(mushroom, aes(x = Cap.Widths, y = Stipe.Lengths))data(mushroom) ggInterval_scatterplot(mushroom, aes(x = Cap.Widths, y = Stipe.Lengths))
oils interval data example.
data(oils)data(oils)
An object of class symbolic_tbl (inherits from tbl_df, tbl, data.frame) with 8 rows and 4 columns.
Adapted from RSDA::oils; see
https://CRAN.R-project.org/package=RSDA.
Cazes, Pierre; Chouakria, Assia; Diday, Edwin; and Schektman, Youri (1997). Extension de l'analyse en composantes principales a des donnees de type intervalle. Revue de Statistique Appliquee, 45(3), 5–24.
data(oils) ggInterval_scatterplot(oils, aes(x = GRA, y = IOD))data(oils) ggInterval_scatterplot(oils, aes(x = GRA, y = IOD))
It will be a good way to unify all symbolic data object in R that collects all useful symbolic analysis tools such like RSDA into the same class for management. In this way, user who wants to do some study in symbolic data will be more convenient for searching packages.Thus,RSDA2sym collecting RSDA object into ggInterval object will do for plot(ggplot) and RSDA's analysis.
RSDA2sym(data=NULL,rawData=NULL)RSDA2sym(data=NULL,rawData=NULL)
data |
an interval data, which may transfrom by RSDA::classic.to.sym .Note:data is a necessary parameter,and must have symbolic_tbl class. |
rawData |
rawData, which can be transformed to interval data, must be a data frame and match to data. |
Return an object of class "ggInterval", which has interval-valued data and related outputs as follows.
intervalData - The Interval data after converting also known as a RSDA object.
rawData - Classical data that user input.
clusterResult - Cluster results .If the groupby method is a clustering method then it will exist.
statisticsDF - A list contains data frame including some typically statistics in each group.
#'
r<-ggInterval::Cardiological mySym<-RSDA2sym(r) mySym$intervalDatar<-ggInterval::Cardiological mySym<-RSDA2sym(r) mySym$intervalData
scale for symbolic data table
scale(x, ...) ## Default S3 method: scale(x, center = TRUE, scale = TRUE, ...) ## S3 method for class 'symbolic_tbl' scale(x, ...) ## S3 method for class 'symbolic_interval' scale(x, ...)scale(x, ...) ## Default S3 method: scale(x, center = TRUE, scale = TRUE, ...) ## S3 method for class 'symbolic_tbl' scale(x, ...) ## S3 method for class 'symbolic_interval' scale(x, ...)
x |
A ggInterval object. It can also be either RSDA object or classical data frame, which will be automatically convert to ggInterval data. |
... |
Used by other R function. |
center |
same as base::scale, either a logical value or numeric-alike vector of length equal to the number of columns of x, where nmeric-alike means that as.numeric(.) will be applied successfully if is.numeric(.) is not true. |
scale |
same as base::scale, either a logical value or a numeric-alike vector of length equal to the number of columns of x. |
Return a scale ggInterval object.
#For all interval-valued scale(facedata) #For both interval-valued and modal multi-valued scale(mtcars.i)#For all interval-valued scale(facedata) #For both interval-valued and modal multi-valued scale(mtcars.i)
This function compute the symbolic standard deviation.
sd(x, ...) ## Default S3 method: sd(x, na.rm = FALSE, ...) ## S3 method for class 'symbolic_tbl' sd( x, method = c("billard", "centers", "interval", "B", "BD", "BG"), na.rm = FALSE, ... ) ## S3 method for class 'symbolic_interval' sd( x, method = c("billard", "centers", "interval", "B", "BD", "BG"), na.rm = FALSE, ... )sd(x, ...) ## Default S3 method: sd(x, na.rm = FALSE, ...) ## S3 method for class 'symbolic_tbl' sd( x, method = c("billard", "centers", "interval", "B", "BD", "BG"), na.rm = FALSE, ... ) ## S3 method for class 'symbolic_interval' sd( x, method = c("billard", "centers", "interval", "B", "BD", "BG"), na.rm = FALSE, ... )
x |
First symbolic variables. |
... |
As in R sd function. |
na.rm |
As in R sd function. |
method |
The method to use. |
Supported interval-valued methods are:
"billard": standard deviation based on the Billard
univariate variance formula.
"centers": standard deviation of interval centers.
"interval": interval-valued standard deviation obtained by
standardizing lower and upper bounds separately.
"B": method-matched standard deviation defined by
.
"BD": method-matched standard deviation defined by
.
"BG": method-matched standard deviation defined by
.
Return a real number.
Bertrand, Patrice and Goupil, Francoise (2000). Descriptive Statistics for Symbolic Data. In Hans-Hermann Bock and Edwin Diday (eds.), Analysis of Symbolic Data, pp. 106–124. Berlin and Heidelberg: Springer.
Billard, Lynne and Diday, Edwin (2006). Symbolic Data Analysis: Conceptual Statistics and Data Mining. Chichester, UK: John Wiley and Sons.
Billard, Lynne (2008). Sample covariance functions for complex quantitative data. In Proceedings of the World IASC Conference, pp. 157–163, Yokohama, Japan.
summary for symbolic data table
summary(object, ...) ## Default S3 method: summary(object, ...) ## S3 method for class 'symbolic_tbl' summary(object, ...) ## S3 method for class 'symbolic_interval' summary(object, ...) ## S3 method for class 'symbolic_modal' summary(object, summary_fun = "mean", ...)summary(object, ...) ## Default S3 method: summary(object, ...) ## S3 method for class 'symbolic_tbl' summary(object, ...) ## S3 method for class 'symbolic_interval' summary(object, ...) ## S3 method for class 'symbolic_modal' summary(object, summary_fun = "mean", ...)
object |
an object for which a summary is desired. |
... |
additional arguments affecting the summary produced. |
summary_fun |
only works when the symbolic_modal class input, it determine which summary function be applied for each modal. |
Return a summary table.
#For all interval-valued summary(facedata) #For both interval-valued and modal multi-valued summary(Environment) summary(Environment$URBANICITY, summary_fun = "quantile")#For all interval-valued summary(facedata) #For both interval-valued and modal multi-valued summary(Environment) summary(Environment$URBANICITY, summary_fun = "quantile")