grd_data_generic: Wrap data sources with non-standard ordering

Description Usage Arguments Value

View source: R/data-generic.R

Description

Whereas grd() objects always index grd_data() using y, x axis order with y values decreasing with increasing index value, data are often stored in other configurations. The grd_data_generic() class wraps the common case where axis order or axis direction differs from the default. The resulting object retains a reference to the underlying data but takes care of rearranging the calls to dim(), [, and [<- such that the object can be indexed and modified in the same way.

Usage

1
2
3
4
5
grd_data_generic(
  grid_data,
  data_order = grd_data_order(grid_data),
  ptype = grd_data_ptype(grid_data)
)

Arguments

grid_data

The data member of a grd(). This is typically an array but can also be an S3 object with the proper methods implemented (e.g., grd_data_generic()).

data_order

A character vector with the same length as dim(grid_data) specifying the axis order and axis direction of indices in the x y direction. The default c("y", "x") indicates column-major ordering with y values decreasing in the positive i index direction and x values increasing in the positive j index direction. Use "-y" or "-x" to switch axis directions. Use NA to indicate a non-xy dimension.

ptype

The R object type that should be used to represent the data.

Value

An object of class grd_data_generic.


paleolimbot/grd documentation built on Dec. 22, 2021, 6:38 a.m.