Learn R Programming

stplanr (version 0.1.4)

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
"weightfield"(x)
"weightfield"(x) <- value
"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 varname is used, otherwise the first column is used.

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.