merge_dt: Merge two data.tables

View source: R/merge_two_datatable_row_by_row.R

merge_dtR Documentation

Merge two data.tables

Description

Merge two data.tables to form a large data.table with all combination of rows. It is similar to base::merge(df1, df2).

Usage

merge_dt(dt1, dt2, id1 = FALSE, id2 = FALSE)

Arguments

dt1

first data.table

dt2

second data.table

id1, id2

add a id number for each row of dt1 or dt2 if TRUE. The purpose of adding id is for future "by" operation based on rows

Value

data.table, which has n1 x n2 rows where n1 and n2 are number of rows of dt1 and dt2

Examples

# make up two data tables


GL-Li/mytoolbox documentation built on May 16, 2024, 4:29 p.m.