assert_gwas: Validate a dataframe as a gwas

Description Usage Arguments Value Examples

Description

Validate that a dataframe contains values that are consistent with being a gwas.

Usage

1
assert_gwas(data, on_error = on_error_options)

Arguments

data

input data, a dataframe

on_error

if data does _not_ validate, whether to show the reasons and whether to throw: all: show all the problems and throw an exception none: don't show anything, but throw an exception summary: show a summary and throw an exception tell: just return TRUE if OK and FALSE if invalid

Value

TRUE if data is valid and FALSE if invalid (only when "on_error" == "tell")

Examples

1
2
3
4
5
 assert_gwas(demo_data) # TRUE

 broken_data <- demo_data # make copy
 broken_data$POS[1] <- 0 # Zero is not a valid value for POS
 assert_gwas(broken_data, on_error="tell") # FALSE

richardslab/MRutils documentation built on Dec. 22, 2021, 4 p.m.