fcor | R Documentation |

This function calculates Pearson/Spearman correlations between all pairs of features in a matrix/dataframe much faster than the base R cor function. It is also possible to simultaneously calculate mutual rank (MR) of correlations as well as their p-values and adjusted p-values. Additionally, this function can automatically combine and flatten the result matrices. Selecting correlated features using an MR-based threshold rather than based on their correlation coefficients or an arbitrary p-value is more efficient and accurate in inferring functional associations in systems, for example in gene regulatory networks.

fcor( data, use = "everything", method = "spearman", mutualRank = TRUE, pvalue = FALSE, adjust = "BH", flat = TRUE )

`data` |
A numeric dataframe/matrix (features on columns and samples on rows). |

`use` |
The NA handler, as in R's cov() and cor() functions. Options are "everything", "all.obs", and "complete.obs". |

`method` |
a character string indicating which correlation coefficient is to be computed. One of "pearson" or "spearman" (default). |

`mutualRank` |
logical, whether to calculate mutual ranks of correlations or not. |

`pvalue` |
logical, whether to calculate p-values of correlations or not. |

`adjust` |
p-value correction method (when pvalue = TRUE), a character string including any of "BH" (default), "bonferroni", holm", "hochberg", "hommel", or "none". |

`flat` |
logical, whether to combine and flatten the result matrices or not. |

Depending on the input data, a dataframe or list including cor (correlation coefficients), mr (mutual ranks of correlation coefficients), p (p-values of correlation coefficients), and p.adj (adjusted p-values).

`pcor`

, `p.adjust`

,
and `graph_from_data_frame`

## Not run: set.seed(1234) data <- datasets::attitude cor <- fcor(data = data) ## End(Not run)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.