Read Point Pattern From Data File
Reads a point pattern dataset from a text file.
scanpp(filename, window, header=TRUE, dir="", multitype=FALSE)
- String name of the file containing the coordinates of the points in the point pattern, and their marks if any.
- Window for the point pattern. An object of class
- Logical flag indicating whether the first line of the
file contains headings for the columns.
- String containing the path name of the directory
filenameis to be found. Default is the current directory.
- Logical flag indicating whether marks are to be
interpreted as a factor (
multitype = TRUE) or as numerical values (
multitype = FALSE).
This simple function reads a point pattern dataset from a file containing the cartesian coordinates of its points, and optionally the mark values for these points.
The file identified by
filename in directory
should be a text file that can be read using
Thus, each line of the file (except possibly the first line)
contains data for one point in the
point pattern. Data are arranged in columns. There should be either
two columns (for an unmarked point pattern) or three columns (for a
marked point pattern).
header=FALSE then the first two columns of data
will be interpreted as the $x$ and $y$ coordinates
of points. A third column, if present, will be interpreted as
containing the marks for these points. The marks will be
converted to a factor if
multitype = TRUE.
header=TRUE then the first line of the file should contain
string names for each of the columns of data. If there are columns
y then these will be taken as the
cartesian coordinates, and any remaining column will be taken as
the marks. If there are no columns named
then the first and second columns will be taken as the cartesian
Note that there is intentionally no default for
The window of observation should be specified.
If you really need to estimate the window, use the
- A point pattern (an object of class