View source: R/qtool_functions.R
getClusterSamples | R Documentation |
This function cluster samples including the input sample or not. If the input sample is not include, cosine similarity between the input sample and the cluster centers is computed to obtain the list of samples included in the closest cluster to the input sample
getClusterSamples(matrix, cell, include = TRUE)
matrix |
matrix with variables in rows and samples in columns |
cell |
one-column matrix with data of input sample, with one row per variable |
include |
a logical value to indicate if input sample should be used for clustering or not |
vector with list of samples in the closest cluster of the input sample
matrix <- cbind(s1=runif(10, min=0, max=1), s2=runif(10, min=0, max=1),s3=runif(10, min=0, max=1)) rownames(matrix)<-paste0("c", seq(1,10)) cell<-matrix(runif(n = 3, min = 0, max = 1)) colnames(cell)<-"input" samples<-getClusterSamples(t(matrix), cell)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.