test.orphan_rec: Tests for orphaned records

Description Usage Arguments Examples

View source: R/tests.R

Description

Tests that there is a one to many relationship between the left and right dataset

Usage

1
2
## S3 method for class 'orphan_rec'
test(setup, primary_df, related_df, ...)

Arguments

setup

the setup class

primary_df

the primary dataframe

related_df

the related dataframe

...

other arguments passed to the function

Examples

1
2
3
4
5
6
7
primary_df <- data.frame(id1 = c(1,2,2,3), id2 = c(1,1,2,1), y = c(1,1,2,5))
related_df <- data.frame(id1 = c(1,2,3), id2 = c(1,1,1), x = c(1,2,3))

setup <- setup_test_orphan_rec(primary_df = "df1", related_df = "df2", 
                               primary_key = c("id1", "id2"), foreign_key = c("id1", "id2"))
test <- test(setup, primary_df, related_df)
## test$test_result returns TRUE

holmesjoli/validR documentation built on Dec. 1, 2019, 12:38 p.m.