extractPairedRows: Extract paired and unpaired rows from a data frame.

View source: R/func__extractPairedRows.R

extractPairedRowsR Documentation

Extract paired and unpaired rows from a data frame.

Description

Assuming a data frame with a column storing pair IDs, this function extracts rows sharing the same pair IDs from the data frame. It can be used to isolate symmetric associations from asymmetric associations. Specifically, a pair of random variables X and Y is considered as in a symmetric association if both models Y ~ X and X ~ Y display a significant effect of the explanatory variable, respectively. On the contrary, X and Y is in an asymmetric association if either model shows insignificance.

Usage

extractPairedRows(x, pair.col = "pair")

Arguments

x

A data frame containing pair IDs.

pair.col

A character or integer specifying which column is providing pair IDs.

Author(s)

Yu Wan (wanyuac@126.com)

Examples

a <- rbind.data.frame(subset(assoc[["assoc"]], score >= 1.5 | (s_d == 1 & dif == 0)), stringsAsFactors = FALSE)
ap <- extractPairedRows(x = a, pair.id = "pair")


wanyuac/GeneMates documentation built on Aug. 12, 2022, 7:37 a.m.