linkNode: Link nodes to spatial data

Description Usage Arguments Details Value See Also Examples

View source: R/linkNode.R

Description

linkNode links a node of the Bayesian network to its corresponding spatial dataset (in raster format), returning a list of objects, including the spatial data and relevant information about the node.
linkMultiple operates on multiple rasters and nodes.

Usage

1
2
3
4
linkNode(layer, network, node, intervals, categorical = NULL,
  verbose = TRUE)

linkMultiple(spatialData, network, lookup, verbose = TRUE)

Arguments

layer

character (path to raster file) or an object of class "RasterLayer". The spatial data corresponding to the network node in argument node.

network

The Bayesian network. An object of class grain (from package bnlearn), or a character (the path to the .net file to be imported)

node

character. A network node associated to the file in layer argument

intervals

A list of numeric vectors. For categorical variables the raster values associated to each state of the node, for continuous variables the boundary values dividing into the corresponding states.

categorical

logical. Is the node a categorical variable? Default is NULL.

verbose

logical. If verbose = TRUE a summary of class boundaries and associated nodes and data will be printed to screen for quick checks.

spatialData

character or list of objects of class 'RasterLayer'. The raster files corresponding to nodes, as vector of full file paths or as list of rasters (objects of class 'RasterLayer').

lookup

character or a formatted list. This argument can be provided as path to a comma separated file or a formatted list (see setClasses )

Details

In future releases, this function may be rewritten to provide an S4/S3 object.

Value

linkNode returns a list of objects, including the spatial data and summary information about each node.
linkMultiple returns a list of lists. Each element of the list includes the spatial data and summary information for each of the input nodes.

See Also

dataDiscretize; setClasses

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Load data into global environment
data(ConwyData)
list2env(ConwyData, environment())

network <- LandUseChange
lst <- linkNode(layer=ConwyLU, network, node='CurrentLULC', intervals=c(2, 3, 1))
lst

## Link the Bayesian network to multiple spatial data at once, using a lookup list
spatialData <- c(ConwyLU, ConwySlope, ConwyStatus)
lookup <- LUclasses
linkMultiple(spatialData, network, lookup, verbose = FALSE)

bnspatial documentation built on Nov. 18, 2017, 4:13 a.m.