SfcArray-class {via}R Documentation

Array of 'sf'-derived class data

Description

Array class for easier navigation of vector spatial datasets

Arguments

stack

A list of sf-class objects or sfc-class objects.

index

A vector, matrix or array type object. Includes either the indices of layers in the stack, or their names.

dim

A numeric vector. Same as for array, creates proxy procedurally.

Details

The class implements structures to organize entire 'sfc' and 'sf' objects that share coordinate reference systems. The 'SfcArray' class is derived from 'XArray' and represents arrays of geometry sets. The 'SfArray' class is derived from 'SfArray', that allows the wrapping of 'sf' objects with attributes. Subsetting rules were defined using the proxy object in the @index slot. See examples for implementations.

The classes have two slots: @stack: A list object with multiple 'sf' class layers, the actual data. @index: A proxy object that represents the organization of the layers.

Value

An 'SfcArray' or 'SfArray'-class object.

Examples

# example data
  library(sf) 
  data(paleocoastlines) 
  st <-paleocoastlines@stack
  ind <- 1:nlayers(st)
  dim(ind) <- c(3,2)
  dimnames(ind) <- list(age=c(0, 10, 20), c("margin", "coastlines"))
  sa<- SfcArray(stack=st, index=ind)
  

[Package via version 0.2.0 Index]