powered by
Computes the correlation between a randomly sampled vector from a matrix and a given vector. The sampling is done multiple times to generate a distribution.
CORmat2vecPermu( mat, vec, cor_type = "pearson", bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )
A numeric vector of correlation values for each permutation.
A numeric matrix. For example, each row represents a gene and each column represents a sample.
A numeric vector, with length equal to the number of columns in `mat`.
Type of correlation to calculate: "Pearson", "Kendall", or "Spearman". Default is "Pearson".
Index to divide the task when processing many permutations. Default is 0.
Number of permutations for sampling. Default is 1000.
Seed for random number generation. Default is 99999999.
mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) CORmat2vecPermu(mat, vec)
Run the code above in your browser using DataLab