Description Usage Arguments Value Author(s) Examples
View source: R/multi.cor.var.compare.r
Creates a table of pairwise correlations statistics, with separation of two groups for comparison. This can be used as an exploratory tool to investigate correlations between a specific variable of interest and all other variables within a separate dataset.
1 2 | multi.cor.var.compare(variable, data1, data2, sample_col, group,
ordered = "fisher")
|
variable |
character string indicating the variable of interest for differential correlation (within |
data1 |
first dataframe containing variable of interest |
data2 |
second dataframe containing variable to compare |
sample_col |
character string defining the sample or identifying column in both datasets (common to both dataframes) |
group |
character string defining the grouping variable for comparative differential correlations |
ordered |
character string defining which column the table should be ordered by. Choose from |
a table (or dataframe) with Pearson correlation coefficients (r), associated p-values, fisher r-to-z statistic and BH p-value correlation for each correlation pair
Emily Mears, mears.emilyrose@gmail.com, Matthew Grant, mgra576@aucklanduni.ac.nz
Ben Day, benjamindayengineer@gmail.com
1 2 3 4 5 6 7 | ## Load example dataframes
df1 <- read.csv("example_data/excorr_df1.csv")
df2 <- read.csv("example_data/excorr_df2.csv")
## Run function
multi.cor.var.compare(variable = "NTRpFI", df1, df2, sample_col = "sample", group = "sex")
multi.cor.var.compare(variable = "NTRpFI", df1, df2, sample_col = "sample", group = "sex", ordered = "fisher")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.