Description Usage Arguments Value
View source: R/row_pair_apply.R
Apply a function to all unique pairs of row indices up to num_row.
1 | pairMatrix(num_row, pair_evaluator_fn, also_reverse_row_pairs = FALSE)
|
num_row |
The number of rows to generate index pairs for. |
pair_evaluator_fn |
The function you want applied. It should accept a list of two numbers, the index of row 1 and the index of row2. |
also_reverse_row_pairs |
Optional parameter. When it has its default value of FALSE, it will apply every function only once to any given row pair, e.g. myFunction(1, 2). When it is true, it will also apply the function to every reverse row pair, e.g. myFunction(1, 2) and myFunction(2, 1). |
A matrix of the output of the function for all unique row pairs: c(pair_evaluator_fn(c(1,2), pair_evaluator_fn(c(1,3)), etc.)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.