Description Usage Arguments Value Author(s) Examples
given a data frame, perform pairwise analysis with any function on all pairs of columns
1 | to_pairwise(d, f, unique_pair = TRUE, same_comparison = FALSE, mc = 1)
|
d |
a data frame or tibble or data table |
f |
a function to perform some analysis. The inputs of the function should be two numeric vectors. |
unique_pair |
a binary indicator of whether only unique pairs should be kept.
If |
same_comparison |
a binary indicator of whether to keep self pairs (i.e., "A-A").
If |
mc |
number of cores to use for multi-thread parallel analysis. Pass to
|
a data table contains analysis results of all pairs of columns.
The first two columns ("id1" and "id2") contain the two column names in d
that were included in each pairwise analysis.
Siyang Xia sxia@hsph.harvard.edu
1 2 3 4 | data(peptide_z)
peptide_bi <- as.data.frame((peptide_z > 5) * 1)
output <- to_pairwise(d = peptide_bi, f = peptide_cooccurrence)
head(output)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.