# Multitype point pattern: separate into types
 data(amacrine)
 u <- split(amacrine)
# plot them
 plot(split(amacrine))
# the following are equivalent:
 amon <- split(amacrine)$on
 amon <- unmark(amacrine[amacrine$marks == "on"])
   
# the following are equivalent:
 amon <- split(amacrine, un=FALSE)$on
 amon <- amacrine[amacrine$marks == "on"]
   
# Scramble the locations of the 'on' cells
 u <- split(amacrine)
 u$on <- runifpoint(amon$n, amon$window)
 split(amacrine) <- u
# Point pattern with continuous marks
 data(longleaf)
 <testonly># smaller dataset
	longleaf <- longleaf[seq(1, longleaf$n, by=80)]</testonly>
 # cut the range of tree diameters into three intervals
 long3 <- cut.ppp(longleaf, 3)
 # now split them
 long3split <- split(long3)
# Unmarked point pattern
  data(swedishpines)
# cut & split according to nearest neighbour distance
  f <- cut(nndist(swedishpines), 3)
  u <- split(swedishpines, f)Run the code above in your browser using DataLab