Learn R Programming

CCM (version 1.2)

plot.CCM: Plot CCM correlations

Description

Constructs a boxplot of correlations by class for a test sample

Usage

# S3 method for CCM
plot(x, y, index,  no.plot, ...)

Arguments

x

a CCM correlation matrix as obtained from create.CCM

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 boxplot

Value

if no.plot is TRUE, then a list of correlations by class

Details

This function generates a boxplot of correlations between the training samples and a specific test sample by class

See Also

boxplot; create.CCM for creating the CCM correlation matrix

Examples

Run this code
# 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