Description Usage Arguments Value Examples
View source: R/datacollation.R
Generic function to find a correlation between two columns of a dataframe
1 2 | find_correlations(summary, factor1, factor2, result_name, min_count,
ReturnCI = FALSE, method = "spearman")
|
summary |
dataframe |
factor1 |
char name of first column in the summary dataframe |
factor2 |
char name of second column in the summary dataframe |
result_name |
char name to give the result |
min_count |
minimum number of items in each column (otherwise result will be NA) |
ReturnCI |
whether to return confidence intervals |
Correlation between the two columns (or NA if either factor1 or factor2 contains NA, or if all values of factor1 or factor2 are identical). Also return the pValue on the spearman correlation coefficient and the associated confidence interval at a 0.95 level.
1 2 3 4 | s1 <- data.frame(a = 1:3, b = 1:3 * (1 + rnorm(3) / 10))
find_correlations(s1, "a", "b", "c", 3)
# also return 0.95-CI on the spearman correlation coefficient:
find_correlations(s1, "a", "b", "c", 3, TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.