gmGeostats (version 0.10-6)

getStackElement: 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, ...)

# S3 method for default getStackElement(x, i, ...)

# S3 method for list getStackElement(x, i, ...)

# S3 method for DataFrameStack getStackElement(x, i, MARGIN = stackDim(x), ...)

# S3 method for default setStackElement(x, i, value, ...)

# S3 method for data.frame setStackElement(x, i, value, ...)

# S3 method for list setStackElement(x, i, value, ...)

# S3 method for DataFrameStack setStackElement(x, i, value, MARGIN = stackDim(x), ...)

Arguments

x

container data, typically a DataFrameStack(), but it can also be certain sp::Spatial() object derivates of it

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 is only checked for setStackElement.DataFrameStack and its Spatial derivates; for other methods setStackElement can break the consistency of the stack!

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)

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab