a matrix with the (X,Y)-coordinates of the points. The first column can be the region.id variable giving the
ordering of the observations
region.id
variable that defines the ordering of the observations
output
when TRUE (default) writes the object to a file
type
one of ("NN","distance","inverse"). Nearest neighbors, distance or inverse distance
measure
one of ("euclidean","gcircle","chebyshev","braycur","canberra").The distance measure to be employed in the calculations.
nn
the number of nearest neighbors
cutoff
If type is distance or inverse. Assumes values 1, 2 or 3.
When 1, the cutoff is set to the first quantile of the distribution of distances. When 2 to the median, and when 3 to
the third quantile. Only observations with distance less than cutoff distance are neighbors.
miles
If TRUE (default), distances are in miles, otherwise in Km. (See spDists wcich returns km, and are converted if required)
R
deprecated, spDists uses an approximation to the WGS84 spheroid
shape.name
The name of the shape file. See Details
region.id.name
The name of the region.id variable. See Details
firstline
If TRUE, a first line is added to the output file. See Details
file.name
If output, the name of the output file. See Details
Details
The object created is similar to the content of a 'GWT' file. The output file can be of any format.
In particular, it could be a 'GWT' file. When firstline is TRUE, an header line is added to the 'GWT' file.
The first element is simply a place holder, the second is the number of observations. The name of the shape file
and of the id variable can be specified by the options shape.name and region.id.name respectively.
The function performs a series of test on the region.id variable. If a region.id variable is not specified and
coord only has two columns, a sequence from 1 to the number of observations is generated and
used as identification variable. If region.id is specified
and the first column of coord contains an id variable they should be the same.