count_rows: count_rows

Description Usage Arguments Details Value Examples

View source: R/count_rows.R

Description

Takes two datasets and a character vector of merge variables, and returns the number of rows of a hypothetical merged dataset, without actually performing the merge. Useful in cases where merge variables may not be unique, and a merge could result in an R-crashingly large dataset.

Usage

1
count_rows(x, y, by, by.x = by, by.y = by)

Arguments

x

data.frame. First data to merge

y

data.frame. Second data to merge

merge_ids

character vector. Merge variables

Details

h/t Joris Meys and his Stack Overflow post http://stackoverflow.com/questions/7441188/how-to-efficiently-merge-two-datasets

Value

number of rows of the merged dataset

Examples

1
count_rows(data.frame('id'=c(1,1,1,2,2,3)), data.frame('id'=c(1,1,2,2,3,4)), 'id')

mfriedri12/fedmatch documentation built on Aug. 4, 2017, 7:41 a.m.