test.values: Test expected values

Description Usage Arguments Value Examples

View source: R/tests.R

Description

Tests if the vector/column contains values other than expected

Usage

1
2
## S3 method for class 'values'
test(setup, df, ...)

Arguments

setup

the setup class

df

the dataframe

...

other arguments passed to the function

Value

class with test_result, test_message, test_description

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
df <- data.frame(x = 1:4, y = 5:8)
setup <- setup_test_values("df_name", "x", values = 1:4)

test <- test(setup, df)
## test$test_result returns TRUE

setup <- setup_test_values("df_name", "y", values = 1:4)
test <- test(setup, df)
## test$test_result returns FALSE

## End(Not run)

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