[R-sig-Geo] Re: spatstat output

Adrian Baddeley adrian.baddeley at uwa.edu.au
Mon Jul 8 12:43:36 CEST 2013


Catalin Roibu writes:

   > Is there a possibility to extract only the r, CI's envelope and L function
   > from the output of spatstat?

   > I use this code
   > E <- alltypes(df1, Kest, nsim = 100, envelope = TRUE, ...)

'E' contains the K functions and envelopes computed for points of each type, taken separately.
Do you want to extract the data for one of these types, or all types?

E is a 'fasp' object (representing an array of envelopes) with dimensions p * 1 where p is the number of types.
For example
            K2 <- E[2,1] 
will extract the envelope for the second type of points.
If you plot(K2) you get just this envelope.

To extract the data from this envelope, 
     K2data <- as.data.frame(K2)
this returns a data frame with a column of r values, column of L values, and so on.

 > And second question, is there a possibility to modify the margin of plot in spatstat?
  > plot(E, sqrt(./pi) - r ~ r, ylab = "L(r)-r",main=NULL,sub=NULL,las=1)

See help(plot.fasp).

Yes, the arguments 'sub' and 'las' will be handled (they are passed to plot.default).
However, sub=NULL will not do anything - if you wanted to remove the x axis label 
that should be xlab=""

If you mean that you want to increase the space between the panels in the plot,
use the argument 'mar.panel' described in help(plot.fasp).

A

Prof Adrian Baddeley FAA
University of Western Australia  /and/ CSIRO Mathematics, Informatics & Statistics
Mail: <cet.uwa.edu.au>             Skype: adrian.baddeley


More information about the R-sig-Geo mailing list