bk_validate: VALIDATOR

View source: R/bk.R

bk_validateR Documentation

VALIDATOR

Description

Check compatibility of entries in a bk grid object, and fill in any missing ones

Usage

bk_validate(g)

Arguments

g

a "bk" object or a list accepted by bk_make

Details

This constructs the object and fills missing entries. It then does some sanity checks and computes the number of missing grid points (in list entry n_missing).

The function removes/introduces idx_grid depending on whether gval is a vector (single-layer case) or a matrix (usually a multi-layer case). If idx_grid is missing and gval is a matrix, it is assumed to contain all grid-points (including NAs)

The function also assigns dimension names in the order 'y', 'x' (unless otherwise specified) for gdim, gres, and gyx.

Value

a validated "bk" object

Examples


# auto-print reminds users to validate
bk_validate(list(gdim=10, gres=0.5))
bk_validate(list(gval=rnorm(10^2), gdim=10, gres=0.5))

deankoch/pkern documentation built on Oct. 26, 2023, 8:54 p.m.