wts: list of general weights corresponding to neighbours
coords: matrix of region point coordinates, a Spatial object (points or polygons), or an sfc object (points or polygons)
proj4string: default NULL; if coords is a Spatial or sf object, this value will be used, otherwise the value will be converted appropriately
as_sf: output object in Spatial or sf format, default FALSE, set to TRUE if coords is an sfc object and FALSE if a Spatial object
listw: a listw object of spatial weights
df: a data frame read from a shapefile, derived from the output of nb2lines
i: character name of column in df with from entity index
i_ID: character name of column in df with from entity region ID
j: character name of column in df with to entity index
wt: character name of column in df with weights
Details
The neighbour and weights objects may be retrieved by converting the specified columns of the data slot of the SpatialLinesDataFrame object into a spatial.neighbour object, which is then converted into a weights list object.
Returns
nb2lines and listw2lines return a SpatialLinesDataFrame object or an sf object; the data frame contains with the from and to indices of the neighbour links and their weights. df2sn converts the data retrieved from reading the data from df back into a spatial.neighbour object.