Description Usage Arguments Details Value See Also Examples
linkNode
links a node of the Bayesian network to the corresponding spatial data, returning a list of objects,
including the spatial data and relevant info about the node.
linkMultiple
operates on multiple nodes and related spatial data.
1 2 3 4 5 6 7 8 9 10 11 12 |
layer |
character (path to file) or an object of class "RasterLayer",
"sf" or "SpatialPolygonsDataFrame". The spatial data corresponding to the network node as by argument |
network |
The Bayesian network. An object of class |
node |
character. The network node to be coupled with the file/object indicated by |
intervals |
A list of numeric vectors. For categorical variables the spatial data values associated to each state of the node, for continuous variables the boundary values dividing into the corresponding states, including upper and lower boundaries. |
categorical |
logical, or NULL. Is the node a categorical variable? If NULL the function will attempt to assign the
logical value by looking at |
field |
character. Only for spatial vector data (e.g. shapefile), the field/column names in the attribute table corresponding to the nodes, ordered accordingly. |
verbose |
logical. If |
spatial |
logical. Should the output list include the input as raster or spatial vector? Default is TRUE, returning the list with an object of class "RasterLayer" or "sf" for each node associated. If FALSE, returns only the values. |
spatialData |
character with path to one or more raster files or to a single spatial vector file, or a list of objects of
class 'RasterLayer' (for raster), or a single object of class 'sf' or 'SpatialPolygonsDataFrame' (for spatial vector).
The spatial data associated to given network nodes, provided as file paths or as (list of) spatial objects. Items must be ordered
accordingly to the corresponding nodes listed in |
lookup |
character (path to file) or a formatted list. This argument can be provided as path to a comma separated file or a formatted list (see |
In future releases, this function may be rewritten to provide an S4/S3 object.
linkNode
returns a list of objects, including the spatial data and the related node information.
linkMultiple
returns a list of lists. Each element of the list includes the spatial data and summary information for each of the input nodes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Load data into global environment
list2env(ConwyData, environment())
lookup <- LUclasses
network <- LandUseChange
ln <- linkNode(layer=ConwyLU, network, node='CurrentLULC', intervals=c(2, 3, 1))
ln
## Link the Bayesian network to multiple spatial data at once, using a lookup list
spatialData <- c(ConwyLU, ConwySlope, ConwyStatus)
linkMultiple(spatialData, network, lookup, verbose = FALSE)
## Method for spatial vectorial data (i.e. class 'sf' or 'SpatialPolygon')
spatialData <- system.file("extdata", "Conwy.shp", package = "bnspatial")
lst <- linkMultiple(spatialData, network, lookup, field= c('LU', 'Slope', 'Status'))
lst
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.