Skip to contents

Create a data frame of bidirectional comparisons from unidirectional comparisons

Usage

make_bidirectional(compare)

Arguments

compare

A 2-column data frame with name(s) of target species in column 1, and name(s) of outgroup species in column 2.

Value

A 2-column data frame as in compare, but extended to contain bidirectional comparisons. If the data frame in compare has N rows, the output data frame should contain 2N rows.

Examples

spp_outgroup <- data.frame(species = "spA", outgroup = "spB")
comp_bi <- make_bidirectional(spp_outgroup)
comp_bi
#>   species outgroup
#> 1     spA      spB
#> 2     spB      spA