Learn R Programming

dwtools (version 0.8.3.9)

data.equal.data.table: Data equal in two data.tables

Description

Test if data equal in two data.tables, can ignore order of rows or columns.

Usage

data.equal.data.table(DT1, DT2, ignore_row_order = TRUE, ignore_col_order = FALSE, check.attributes = FALSE)

Arguments

DT1
data.table.
DT2
data.table.
ignore_row_order
logical.
ignore_col_order
logical.
check.attributes
logical, only FALSE supported.

Examples

Run this code
suppressPackageStartupMessages(library(dwtools))

DT1 <- dw.populate(scenario="fact")
DT2 <- copy(DT1)[sample(1:nrow(DT1),nrow(DT1),FALSE)]
data.equal.data.table(DT1,DT2,ignore_row_order=TRUE)

setcolorder(DT2,sample(names(DT2),length(DT2),FALSE))
data.equal.data.table(DT1,DT2,ignore_row_order=TRUE,ignore_col_order=TRUE)

Run the code above in your browser using DataLab