Learn R Programming

MiMIR (version 1.5)

cor_assoc: cor_assoc

Description

Function to calulate the correlation between 2 matrices

Usage

cor_assoc(dat1, dat2, feat1, feat2, method = "pearson", quiet = FALSE)

Value

correlations of the selected variables in the 2 martrices

Arguments

dat1

matrix 1

dat2

matrix 2

feat1

vector of strings with the names of the selected variables in dat

feat2

vector if strings with the names of the selected variables in dat2

method

indicates which methods of the correlation to use

quiet

logical to suppress the messages in the console

See Also

plot_corply

Examples

Run this code
library(stats)

#load the dataset
m <- as.matrix(synthetic_metabolic_dataset)

#Compute the pearson correlation of all the variables in the data.frame metabolic_measures
cors<-cor_assoc(m, m, MiMIR::metabolites_subsets$MET63,MiMIR::metabolites_subsets$MET63)

Run the code above in your browser using DataLab