Re: [R] about"Riply's K function"and "envelope"

From: Sundar Dorai-Raj <sundar.dorai-raj_at_pdf.com>
Date: Tue 28 Feb 2006 - 07:59:57 EST

So as not to offend the authors of spatial and splancs, please describe what "not good" means in this context? What is it about spatstat::envelope that cannot be achieved by spatial::Kenvl? Besides, the author of the K-function (Ripley himself) wrote the latter package. Here's an example:

library(spatial)
set.seed(24)
X <- list(x = runif(100), y = runif(100),

           area = c(xl = 0, xu = 1, yl = 0, xu = 1))

ppregion(X)
plot(Kfn(X, 0.5), type = "b", xlab = "distance", ylab = "L(t)")
set.seed(42)

lims <- Kenvl(0.5, 100, Psim(69))
lines(lims$x, lims$l, lty = 2, col = "darkred") lines(lims$x, lims$u, lty = 2, col = "darkred")

library(spatstat)
Y <- ppp(X$x, X$y, X$area[1:2], X$area[3:4]) set.seed(42)
Yenv <- envelope(Y, nsim = 100)

Of course, these will look different because Kenvl and Kfn actually compute the L-function (which is a better visual tool), but otherwise they should be very similar.

(I must admit I haven't read all the documentation for spatstat so I may be off base as to what ?envelope is actually doing.)

--sundar

zhang jian wrote:
> I have tried the package"spatial" and "splance".But it is not good.
> I think there are some questions when I run the programs.
> I attach a part of data. can you help me try to do it? And attach a simple
> program to me.
> my plot is square, 500m*500m.
>

>>PIKO[1:10,]

>
> code species dbh x y tag status branch
> 92 10142 PIKO 38.9 6.05 12.81 10165 alive 0
> 109 10213 PIKO 41.0 6.71 26.21 10202 alive 0
> 135 10222 PIKO 48.3 18.98 21.28 10214 alive 0
> 146 10223 PIKO 47.0 19.45 22.83 10224 alive 0
> 147 10223 PIKO 20.0 19.74 28.65 10225 alive 0
> 151 10223 PIKO 23.3 17.03 28.88 10229 alive 0
> 152 10223 PIKO 33.5 16.94 27.25 10230 alive 0
> 176 10232 PIKO 43.5 19.20 30.88 10248 alive 0
> 181 10233 PIKO 39.0 18.10 35.60 10252 alive 0
> 212 10243 PIKO 71.2 6.94 37.27 10281 alive 0
>
> "x,y" are coordinations. I want to use them to do Ripley's K analysis.
> thank you very much!
> Help me!
> jian zhang
>
> On 2/27/06, Sundar Dorai-Raj <sundar.dorai-raj@pdf.com> wrote:
>
>>
>>
>>zhang jian wrote:
>>
>>>hi!
>>>I did Riply's K function and envelope in the package "SPATSTAT". When
>>
>>the
>>
>>>species number is less, it can work well and it is quickly. But when the
>>>species number is more(example:2000), it told me"memory limit". So I
>>
>>change
>>
>>>"memory limit". But the speed is very slow. I took 13 hours to run the
>>>programe.
>>>Perhaps there are other methods that can do it. Or just change some
>>>parsmeters.
>>>who can help me?
>>>Thank you!
>>>                                                               Jian
>>
>>Zhang
>>
>>I don't have an example, but have you looked at ?Kenvl in the spatial
>>package?
>>
>>HTH,
>>
>>--sundar
>>

>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Feb 28 08:09:09 2006

This archive was generated by hypermail 2.1.8 : Tue 28 Feb 2006 - 09:08:49 EST