[R] Rhelp: Need help interpreting plots in spatstat
Lisa Schweitzer
lschwei at ucla.edu
Sat May 29 18:26:23 CEST 2004
Hello everybody--
I have been playing with my data in spatstat, and what I'd like to
present is a basic exploratory spatial analysis. I have used the
following code, using a ppp.object called tsdspoints. The code
develops the simulations and the envelopes I want, but I don't
understand my first plot here, the [tsds.ghat.short$r,
tsds.ghat.short$raw]...I cobbled together this code from some class
examples used by a prof of mine, and I don't really know how to
interpret what is going on. The subsequent lines, I'm pretty sure,
represent the empirical Ghat and the simulation envelope...but that
first plot stumps me.
You can see a pdf of the resulting plot if you download it from my
website : www.bol.ucla.edu/~lschwei/sample.pdf WARNING: this is
immediate download.
THE CODE: ######
ghat.env <- function(n, s, r, win=owin(myOwin){
hold <- matrix(0, s, length(r))
for(i in 1:s){
hold[i,] <- Gest(runifpoint(n, win=myOwin), r=r)$raw
}
mn <- apply(hold, 2, mean)
Up <- apply(hold, 2, max)
Down <- apply(hold, 2, min)
return(data.frame(mn, Up, Down))
}
tsds.ghat <- Gest(tsdspoints)
tsds.ghat.short <- tsds.ghat[tsds.ghat$r <= .15, ]
tsds.cdf <- 1-exp(-40*pi*(tsds.ghat.short$r^2))
plot(tsds.ghat.short$r, tsds.ghat.short$raw, xlab="Distance (degrees)",
ylab="Ghat", main=" Transport, Storage, and Disposal sites (TSDs)")
lines(tsds.ghat.short$r, tsds.cdf)
tsds.env <- ghat.env(n=40, s=100, r=tsds.ghat$r)
tsds.env.short <- tsds.env[tsds.ghat$r <= .15, ]
lines(tsds.ghat.short$r, tsds.env.short$Up, lty=5)
lines(tsds.ghat.short$r, tsds.env.short$Down, lty=5)
###############
Many Thanks,
Lisa
who was working on her stinking dissertation while everybody else was
learning cool things in Vienna.
More information about the R-help
mailing list