grd_collect: Collect a grid in memory

Description Usage Arguments Value Examples

View source: R/collect.R

Description

Collect a grid in memory

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
grd_collect(
  grid,
  i = NULL,
  j = NULL,
  ...,
  ptype = grd_data_ptype(grd_data(grid))
)

## Default S3 method:
grd_collect(
  grid,
  i = NULL,
  j = NULL,
  ...,
  ptype = grd_data_ptype(grd_data(grid))
)

Arguments

grid

A grd_xy(), grd_rct(), or other object implementing grd_*() methods.

i

1-based index values. i indices correspond to decreasing y values; j indices correspond to increasing x values. Values outside the range 1:nrow|ncol(data) will be censored to NA including 0 and negative values.

j

1-based index values. i indices correspond to decreasing y values; j indices correspond to increasing x values. Values outside the range 1:nrow|ncol(data) will be censored to NA including 0 and negative values.

...

Passed to subset methods

ptype

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

Value

A grd_rct() or grd_xy()

Examples

1
2
3
data <- grd_data_generic(volcano, data_order = c("-y", "x"))
(grid <- grd_rct(data))
grd_collect(grid)

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