Checks structure, required columns, and column types for both psn and xyz.

validate_bdsreader(obj, strict = FALSE)

Arguments

obj

An object of class bdsreader.

strict

Logical. If TRUE, stops on first error. If FALSE, returns a character vector of issues.

Value

TRUE if valid, otherwise a vector of issues or an error.

Examples

bds <- init_bdsreader()
validate_bdsreader(bds)  # TRUE
#> [1] TRUE

# Corrupt type
bds$psn$gad <- as.character(bds$psn$gad)
validate_bdsreader(bds)
#> [1] "Column 'gad' in 'psn' is of type character, expected numeric"