Extract or replace some or all of the layers of a layered object, or extract a spatial subset of each layer.
# S3 method for layered
[(x, i, j, drop=FALSE, ...) # S3 method for layered
[(x, i) <- value
# S3 method for layered
[[(x, i) <- value
Usually an object of class "layered"
.
A layered object (class "layered"
).
Subset index for the list of layers. A logical vector, integer vector or character vector specifying which layers are to be extracted or replaced.
Subset index to be applied to the data in each layer.
Typically a spatial window (class "owin"
).
Logical. If i
specifies only a single layer
and drop=TRUE
, then the contents of this layer
will be returned.
Additional arguments, passed to other subset methods if the subset index is a window.
List of objects which shall replace the designated subset, or an object which shall replace the designated element.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner rolfturner@posteo.net and Ege Rubak rubak@math.aau.dk
A layered object represents data that should be plotted in
successive layers, for example, a background and a foreground.
See layered
.
The function [.layered
extracts a designated subset of a layered object.
It is a method for [
for the
class "layered"
.
The functions [<-.layered
and [[<-.layered
replace a designated subset or designated entry of the object by new
values. They are methods for [<-
and [[<-
for the "layered"
class.
The index i
specifies which layers will be retained.
It should be a valid subset index for the list of layers.
The index j
will be applied to each layer. It is typically
a spatial window (class "owin"
) so that each of the layers
will be restricted to the same spatial region.
Alternatively j
may be any subset index
which is permissible for the "["
method for each of the layers.
layered
D <- distmap(cells)
L <- layered(D, cells,
plotargs=list(list(ribbon=FALSE), list(pch=16)))
L[-2]
L[, square(0.5)]
L[[3]] <- japanesepines
L
Run the code above in your browser using DataLab