match_rows: Match Rows Across Two Data Frames

View source: R/S03_Utilities.R

match_rowsR Documentation

Match Rows Across Two Data Frames

Description

Function that returns an index indicating the row in one data frame that matches the row in another data frame.

Usage

match_rows(dtf_to, dtf_from)

Arguments

dtf_to

A data frame with the rows to match over.

dtf_from

A data frame with the rows to compared against.

Value

A list equal in length to the number of rows in dtf_to with the row indices from dtf_from that matches a given row in dtf_to. If no matches are found returns NA.

Examples

dtf_example_1 <- data.frame( c( LETTERS[3:1], 'Z' ), V2 = c( 3:1, 26 ) )
dtf_example_2 <- data.frame( LETTERS[1:6], V2 = 1:6 )
match_rows( dtf_example_1, dtf_example_2 )


rettopnivek/arfpam documentation built on Oct. 20, 2024, 7:24 p.m.