getStackElement {gmGeostats} | R Documentation |
Set or get the i-th data frame of a data.frame stack
Description
Set or get one element of the DataFrameStack()
Usage
getStackElement(x, i, ...)
## Default S3 method:
getStackElement(x, i, ...)
## S3 method for class 'list'
getStackElement(x, i, ...)
## S3 method for class 'DataFrameStack'
getStackElement(x, i, MARGIN = stackDim(x), ...)
## Default S3 method:
setStackElement(x, i, value, ...)
## S3 method for class 'data.frame'
setStackElement(x, i, value, ...)
## S3 method for class 'list'
setStackElement(x, i, value, ...)
## S3 method for class 'DataFrameStack'
setStackElement(x, i, value, MARGIN = stackDim(x), ...)
Arguments
x |
container data, typically a |
i |
index (or name) of the element of the stack to extract or replace |
... |
extra arguments for generic functionality |
MARGIN |
which dimension is the stacking dimension? you seldom want to touch this!! |
value |
for the setting operation, the new data.frame to replace the selected one; note
that the compatibility of the dimensions of |
Value
For the getters, the result is the data.frame of the stack asked for. For the setters the result is the original DataFrameStack with the corresponding element replaced. Spatial methods return the corresponding spatial object, ie. the spatial information of the stack is transferred to the extracted element.
Methods (by class)
-
default
: Set or get one element of theDataFrameStack()
-
list
: Set or get one element of theDataFrameStack()
-
DataFrameStack
: Set or get one element of theDataFrameStack()
-
default
: Set or get one element of theDataFrameStack()
-
data.frame
: Set one element of theDataFrameStack()
in data.frame form -
list
: Set get one element of aDataFrameStack()
in list form -
DataFrameStack
: Set one element of theDataFrameStack()
Examples
ar = array(1:30, dim = c(5,2,3), dimnames=list(obs=1:5, vars=c("A","B"), rep=1:3))
dfs = DataFrameStack(ar, stackDim="rep")
dfs
stackDim(dfs)
getStackElement(dfs, 1)