aggregateData: Aggregates results from the clustering and merging step.

Description Usage Arguments Value Examples

View source: R/aggregateData.R

Description

Aggregates results from the clustering and merging step.

Usage

1
aggregateData(dataInput, labelsInput)

Arguments

dataInput

Data matrix, with first column being SampleID.

labelsInput

cluster labels from PAC.

Value

The aggregated data of dataInput, with average signal levels for all clusters and sample combinations.

Examples

 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))

PAC documentation built on Feb. 18, 2021, 9:06 a.m.