Learn R Programming

SepTest (version 0.0.1)

check.args: Validate common arguments for spatio-temporal grid-based routines

Description

Checks the validity of common inputs used by spatio-temporal estimation and simulation routines: event locations X, spatial window specification s.region, temporal window t.region, and grid resolution n.grid.

Usage

check.args(X, s.region, t.region, n.grid = c(25L, 25L, 20L))

Value

Invisibly returns NULL. Called for its side effect of throwing an error if inputs are invalid.

Arguments

X

A matrix or data frame with at least three columns giving event coordinates \((x, y, t)\). Only the first three columns are used for validation.

s.region

Spatial observation region specification. Either:

  • a numeric vector of length 4 giving c(xmin, xmax, ymin, ymax), or

  • a numeric matrix with two columns giving polygon vertices (x, y) (at least 3 rows).

All values must be finite.

t.region

Numeric vector of length 2 giving c(tmin, tmax) with tmin < tmax. Values must be finite.

n.grid

Integer vector of length 3 giving the number of grid cells in the \(x\), \(y\), and time directions. Must be positive.

Details

This function is intended as a lightweight argument checker used internally by multiple functions. It can also be called directly for debugging input issues.

Examples

Run this code

X <- cbind(runif(100), runif(100), runif(100, 0, 10))
s.region <- matrix(c(0,0, 1,0, 1,1, 0,1), ncol = 2, byrow = TRUE)
t.region <- c(0, 10)
check.args(X, s.region, t.region, n.grid = c(25, 25, 20))

Run the code above in your browser using DataLab