Learn R Programming

NetLogoR (version 1.0.5)

[[,worldArray,ANY,missing-method: Subsetting and replacing for worldArray class

Description

Subsetting and replacing for worldArray class

Usage

# S4 method for worldArray,ANY,missing
[[(x, i)

# S4 method for worldArray,ANY,missing [[(x, i) <- value

# S4 method for worldArray $(x, name)

Value

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

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.

Examples

Run this code
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

Run the code above in your browser using DataLab