plot.CCM | R Documentation |
Constructs a boxplot of correlations by class for a test sample
## S3 method for class 'CCM' plot(x, y, index, no.plot, ...)
x |
a CCM correlation matrix as obtained from |
y |
classes corresponding to the training samples (columns) of 'K' |
index |
the test sample to include in the plot, corresponding to the row of 'K'. |
no.plot |
if TRUE then plotting is turned off and a list of correlations is returned |
... |
additional arguments for |
This function generates a boxplot of correlations between the training samples and a specific test sample by class
if no.plot
is TRUE, then a list of correlations by class
Garrett M. Dancik and Yuanbin Ru
boxplot
;
create.CCM
for creating the CCM correlation matrix
## load data ## data(data.expr) data(data.gender) ## split dataset into training / testing ## train.expr = data.expr[,1:20] test.expr = data.expr[,21:40] train.gender = data.gender[1:20] test.gender = data.gender[21:40] ## CCM using spearman correlation ## K = create.CCM(test.expr, train.expr, method = "spearman") ## plot correlations for the 3rd observation ## plot(K, train.gender, index = 3, main = "correlations for obs #3", xlab = "gender", ylab = "correlation")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.