subset_interchange_col: Look for any two columns of data frames that are...

View source: R/subset_interchange_col.R

subset_interchange_colR Documentation

Look for any two columns of data frames that are interchangeable

Description

For any two columns specified in the data frame (say column A and B), if the combination of column A and B is the same even if they are swapped, it will return it as a data frame or a row number. For example, if column A has "TOM" and "BOB", and the same respective row in column B has "BOB" and "TOM", the row will be extracted as interchangeable. Also, when there is a row with the same value in column A and B, it is also determined to be interchangeable and extracted.

Usage

subset_interchange_col(data, x, y, out.put = c("dataframe", "num"))

Arguments

data

frame to examine.

x

The column name to look up. The column name should be enclosed in double quotation marks.

y

The column name to look up. The column name should be enclosed in double quotation marks.

out.put

Selects whether to return the resulting output as a dataframe or by row name. The default is to return in a data frame.

Value

Returns either the extracted data frame or a vector of row counts.


indenkun/infun documentation built on April 17, 2025, 2:52 p.m.