Skip to content
Prev 13438 / 398502 Next

data format for ppinit

On Mon, 10 Sep 2001, Susumu [ISO-2022-JP] Tanimura/$BC+B<(B $B?8(B wrote:

            
help(ppinit)

gives the documentation for ppinit. If you look at:

example(ppinit)

and examine the file it reads ($R_HOME/library/spatial/data/towns.dat),
you will see that the format described on the help page is easy to 
follow:

69
TOWNS
0 40 0 40 1
  .84 39.16
  .84 33.20
 4.24 34.04
....

69 points
a header
xl xu yl yu scale (the point (xl, yl) is the lower left corner of the
region of interest, (xu, yu) the upper right corner; scale is usually 1)
followed by coordinate pairs for the specified number of points.
This is a different problem. You are assuming that you can use commas to
separate values - in general values should be separated by white
space. For ppinit, your file would need to be:

8
TEST
3 8 6 10 1
4 7
5 7
5 8
5 9
6 7
6 8
6 9
7 8
List of 3
 $ x   : num [1:8] 4 5 5 5 6 6 6 7
 $ y   : num [1:8] 7 7 8 9 7 8 9 8
 $ area: Named num [1:4] 3 8 6 10
  ..- attr(*, "names")= chr [1:4] "xl" "xu" "yl" "yu"
now works fine. Please also refer to the section of Venables & Ripley
(Modern Applied Statistics with S-Plus) about the functions provided in
the spatial package.

Roger