[R] how to change my data to "point data set" in package "SPLANCE"?
Roger Bivand
Roger.Bivand at nhh.no
Mon Feb 27 10:18:27 CET 2006
On Sat, 25 Feb 2006, zhang jian wrote:
> Hi!
> I want to use the package "SPLANCE" to do Ripley's K analysis
> I have a basic question about the package.
> I try to find how to do it, but I cannot.
You asked the same question with reference to the spatial package
associated with MASS last week, and have now asked this one twice. I
replied to your question about spatial, but have not seen any comment
from you on that solution. Perhaps your best choice is to study the
literature of the subject more closely, next to try to learn something of
how data are represented in R, and when you have done that, and if you
still have difficulties, ask again.
Note that the help pages do explain carefully how the functions should be
used, with examples that are documented in the cited references. Please do
try to use the documentation provided with these packages.
Hint: it appears that qumo is a data frame. You can extract the
coordinates in many ways. Data frames are also seen as lists, and since
your data frame has coordinates named "x" and "y", the splancs function
as.points() will work:
library(splancs)
xy <- data.frame(x=rnorm(50), y=rnorm(50))
pxy <- as.points(xy)
plot(pxy)
plot(khat(pxy, sbox(pxy), s=seq(0,2,0.1)), type="l")
> I hope you can help me.
> I donot know how to change my data form to "point data set".
> my data form is:
> > qumo[1:5,]
> code species dbh x y tag status branch
> 223 10312 QUMO 54.5 7.83 44.80 10306 alive 0
> 252 10331 QUMO 48.8 11.44 51.05 10333 alive 0
> 346 10424 QUMO 67.0 14.30 69.68 10443 alive 0
> 395 10511 QUMO 7.8 3.10 83.83 10503 alive 0
> 491 10613 QUMO 57.1 9.12 107.00 10607 alive 0
> "x""y" is the coordinate.
>
> And I think "xl xu yl yu" equl to "0 500 0 500"
> it is a square.
>
> Can you help me?
> Thank you very much.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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
>
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no
More information about the R-help
mailing list