MultiVariAnalysis: Function for Multivariant Analysis

Usage Arguments Examples

View source: R/MultiVariAnalysis.R

Usage

1
MultiVariAnalysis(object, method = "clustering", ...)

Arguments

object

preprocessing data from gcms, lcms and rnaseq

method

clustering methods

...

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (object, method = "clustering", ...) 
{
    if (method == "clustering") {
        clust.genes <- amap::hcluster(x = object@qData, method = "pearson", 
            link = "average")
        clust.arrays <- amap::hcluster(x = t(object@qData), method = "pearson", 
            link = "average")
        heatcol <- colorRampPalette(c("Green", "Red"))(32)
        heatmap(x = object@qData, Rowv = as.dendrogram(clust.genes), 
            Colv = as.dendrogram(clust.arrays), col = heatcol)
    }
    if (method == "pca") {
        p <- amap::acp(object@qData)
        plot(p)
        return(p)
    }
    if (method == "kmeans") {
        cl <- amap::Kmeans(object@qData, 2)
        plot(object@qData, col = cl$cluster)
        points(cl$centers, col = 1:2, pch = 8, cex = 2)
        return(cl)
    }
  }

HTDA documentation built on May 31, 2017, 2:29 a.m.