Description Usage Arguments Details Value Author(s) See Also Examples
Splits a point pattern into subpatterns, and applies the function to each subpattern.
1 2 
data 
Point pattern (object of class 
INDICES 
Grouping variable. Either a factor, a pixel image with factor values, or a tessellation. 
FUN 
Function to be applied to subsets of 
... 
Additional arguments to 
This is a method for the generic function by
for point patterns (class "ppp"
).
The point pattern data
is first divided into subsets
according to INDICES
. Then the function FUN
is applied to each subset. The results of each computation are
returned in a list.
The argument INDICES
may be
a factor, of length equal to the number of points in data
.
The levels of INDICES
determine the destination of each point in data
.
The i
th point of data
will be placed in the subpattern
split.ppp(data)$l
where l = f[i]
.
a pixel image (object of class "im"
) with factor values.
The pixel value of INDICES
at each point of data
will be used as the classifying variable.
a tessellation (object of class "tess"
).
Each point of data
will be classified according to
the tile of the tessellation into which it falls.
If INDICES
is missing, then data
must be a multitype point pattern
(a marked point pattern whose marks vector is a factor).
Then the effect is that the points of each type
are separated into different point patterns.
A list (also of class "anylist"
or "solist"
as
appropriate) containing the results returned
from FUN
for each of the subpatterns.
and \rolf
ppp
,
split.ppp
,
cut.ppp
,
tess
,
im
.
1 2 3 4 5 6 7 8 9 10 11 12 13  # multitype point pattern, broken down by type
data(amacrine)
by(amacrine, FUN=density)
by(amacrine, FUN=function(x) { min(nndist(x)) } )
# how to pass additional arguments to FUN
by(amacrine, FUN=clarkevans, correction=c("Donnelly","cdf"))
# point pattern broken down by tessellation
data(swedishpines)
tes < quadrats(swedishpines, 5, 5)
B < by(swedishpines, tes, clarkevans, correction="Donnelly")
unlist(lapply(B, as.numeric))

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs in the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.