Learn R Programming

stplanr (version 0.1.0)

weightfield: Get or set weight field in SpatialLinesNetwork

Description

Get or set value of weight field in SpatialLinesNetwork

Usage

weightfield(x)

weightfield(x, varname) <- value

weightfield(x, varname) <- value

## S3 method for class 'SpatialLinesNetwork': weightfield(x)

## S3 method for class 'SpatialLinesNetwork,ANY': weightfield(x) <- value

## S3 method for class 'SpatialLinesNetwork,character': weightfield(x, varname) <- value

Arguments

x
SpatialLinesNetwork to use
varname
The name of the variable to set/use.
value
Either the name of the variable to use as the weight field or a dataframe or vector containing the weights to use if varname is passed to the replacement function. If the dataframe contains multiple columns, the column with the same name as <

Details

These functions manipulate the value of weightfield in a SpatialLinesNetwork. When changing the value of weightfield, the weights of the graph network are updated with the values of the corresponding variables.