nc.is.regular.dimension: Determine if a dimension is regular

View source: R/helpers.r

nc.is.regular.dimensionR Documentation

Determine if a dimension is regular

Description

Determine if a dimension is regular (evenly spaced).

Usage

nc.is.regular.dimension(d, tolerance = 1e-06)

Arguments

d

The data to be tested

tolerance

The tolerance for variation in step size, as a fraction of the step size.

Details

Not all dimensions or data are regular (evenly spaced). This function will, given data and optionally a tolerance level, determine if the dimension is regular or not.

Value

TRUE if the data is regular; FALSE if not.

Examples

dat <- c(1, 2, 3, 4, 5, 6, 7)
## TRUE
nc.is.regular.dimension(dat)

dat[7] <- 7.001
## FALSE
nc.is.regular.dimension(dat)


ncdf4.helpers documentation built on April 12, 2025, 1:39 a.m.