library(spatstat)
 # Lansing woods data - multitype points with 6 types
 data(lansing)
 # compute 6 x 6 array of all cross-type K functions
   a <- alltypes(lansing, "K")
   plot(a)
 <testonly># smaller dataset
   sub <- lansing[ seq(1,lansing$n,by=30), ]
   a <- alltypes(sub, "K")</testonly>
 # first three marks only
 b <- a[1:3,1:3]
 plot(b)
 # subset pertaining to hickories
 h <- a[levels(lansing$marks) == "hickory", ]
 plot(h)Run the code above in your browser using DataLab