single_correlation_table | R Documentation |
This function allows to calculating all pairwise correlations of one dimensions with one or many others and directly obtain a CSV table.
single_correlation_table(
MainFactor,
CorrelationFactors,
name = "",
mainFactorName = ""
)
MainFactor |
a vector with which the correlations will be determined |
CorrelationFactors |
a data frame with one or several different variables that will be correlated to the main factor |
name |
name of the file in which the generated table is saved |
mainFactorName |
name of the main factor for better labelling |
Frank E Harrell Jr (2021). Hmisc: Harrell Miscellaneous. R package version 4.6-0. https://CRAN.R-project.org/package=Hmisc
# Dummy data frame generation
df <- data.frame(x = 1:5, y = 2:6, z = 19:23)
# Assume we want to correlate z with all other columns
single_correlation_table(MainFactor = df$z, CorrelationFactors = df[,1:2])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.