subsetting: Subsetting and replacing for 'worldArray' class

[[,worldArray,ANY,missing-methodR Documentation

Subsetting and replacing for worldArray class

Description

Subsetting and replacing for worldArray class

Usage

## S4 method for signature 'worldArray,ANY,missing'
x[[i]]

## S4 replacement method for signature 'worldArray,ANY,missing'
x[[i]] <- value

## S4 method for signature 'worldArray'
x$name

Arguments

x

A worldArray object.

i

Index number or layer name specifying a subset of layer(s) from the worldArray.

value

A replacement worldMatrix layer for one of the current layers in the worldArray.

name

Layer name, normally without back ticks, unless has symbols.

Value

The replacement method returns the original object, but with updated elements. The accessor method extracts the entire layer.

Examples

w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9, data = runif(100))
w2 <- createWorld(0, 9, 0, 9, data = runif(100))
w3 <- createWorld(0, 9, 0, 9, data = runif(100) + 2) # add 2 so different range
a1 <- stackWorlds(w1, w2)
a1[[2]]
a1[[2]] <- w3


PredictiveEcology/NetLogoR documentation built on Jan. 31, 2024, 9:31 p.m.