Constructs a boxplot of correlations by class for a test sample
# S3 method for CCM
plot(x, y, index, no.plot, ...)
a CCM correlation matrix as obtained from create.CCM
classes corresponding to the training samples (columns) of 'K'
the test sample to include in the plot, corresponding to the row of 'K'.
if TRUE then plotting is turned off and a list of correlations is returned
additional arguments for boxplot
if no.plot
is TRUE, then a list of correlations by class
This function generates a boxplot of correlations between the training samples and a specific test sample by class
boxplot
;
create.CCM
for creating the CCM correlation matrix
# NOT RUN {
## 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")
# }
Run the code above in your browser using DataLab