Description Usage Arguments Value Examples

View source: R/aggregateData.R

Aggregates results from the clustering and merging step.

1 | ```
aggregateData(dataInput, labelsInput)
``` |

`dataInput` |
Data matrix, with first column being SampleID. |

`labelsInput` |
cluster labels from PAC. |

The aggregated data of `dataInput`

, with average signal levels for all clusters and sample combinations.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
n = 5e3 # number of observations
p = 1 # number of dimensions
K = 3 # number of clusters
w = rep(1,K)/K # component weights
mu <- c(0,2,4) # component means
sd <- rep(1,K)/K # component standard deviations
g <- sample(1:K,prob=w,size=n,replace=TRUE) # ground truth for clustering
X <- as.matrix(rnorm(n=n,mean=mu[g],sd=sd[g]))
y <- PAC(X, K)
X2<-as.matrix(rnorm(n=n,mean=mu[g],sd=sd[g]))
y2<-PAC(X2,K)
X<-cbind("Sample1", as.data.frame(X)); colnames(X)<-c("SampleID", "Value")
X2<-cbind("Sample2", as.data.frame(X2)); colnames(X2)<-c("SampleID", "Value")
aggregateData(rbind(X,X2),c(y,y2))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.