Learn R Programming

sphet (version 1.5)

read.gwt2dist: Read distance ojbects

Description

The function reads "GWT" files (i.e. generated using distance. It will read also other more general formats (as for example .txt files).

Usage

read.gwt2dist(file, region.id=NULL, skip=1)

Arguments

Value

An object of class distance.

Details

The first line of a 'GWT' file generally contains some information (e.g. the name of the shape file, the number of observations), in which case, skip should be equal to 1. When the file has a 'GWT' extension, the number of observations is generally retrived from the first line. Alternatively, it is fixed to the length of the unique region.id variable.

Examples

Run this code
dist<-read.gwt2dist(file='knn10columbus.GWT', region.id=POLYID)

Run the code above in your browser using DataLab