NBModel: Function to fit Spatial Naive Bayes Model

Description Usage Arguments Value Author(s) References See Also Examples

Description

NBModel is a function to fit Spatial Naive Bayes Model.

Usage

1
2
NBModel(points, map, target = NULL, fac.lap = NULL, isgrid = FALSE,
  contain, ...)

Arguments

points

A SpatialPointsDataFrame-class object or a SpNaBaMatrix-class object.

map

A SpatialPointsDataFrame-class object or NULL. If NULL, points argument must be a SpNaBaMatrix-class object.

target

character or numeric or logical or NULL. Indicates the columns of binmatrix slot to be consired as target factors.

fac.lap

numeric or NULL. it indicates the laplace factor to be applied. If NULL or missing the laplace factor applied is 0.01.

isgrid

logical (FALSE by default). If is TRUE idicates that the map is gridded, if is FALSE the grid is calculated based on the bounding box of the map.

contain

Character (simple or properly). By default simple, it implies a simple contention evaluation (see rgeos::gContains())). properly suggests a properly contention evaluation (see gContainsProperly)). It requieres that points argument should be a SpatialPointsDataFrame-class object and map argument should be declared as a SpatialPolygonsDataFrame-class object.

...

Arguments pass to grd_build function. See grd_build.

Value

NBModel: An object of class SpNaBaModel.

Author(s)

Enrique Del Callejo Canal (edelcallejoc@gmail.com), based on implemented algortihms in web platform SPECIES (see References).

References

http://species.conabio.gob.mx/

See Also

SpNaBaMatrix-class, SpNaBaCounts, SpNaBaProbs, SpNaBa-methods, SpNaBaEps, epsilon, SpNaBaScore, score

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Using the function id_pts() for spatial data --------

library(sp)
library(rgeos)
library(rgdal)
library(raster)

# Loading data
data(Mex0)
data(mammals)

# Using an SpatialPointsDataFrame and
# SpatialPolygonsDataFrame object

x.model <- NBModel(mammals, Mex0, target = 1:10, fac.lap = 0.01)


# Using an SpNaBaMAtrix object

# Grid
Mex0.grd<-grd_build(Mex0)

# Identification points of mammals
x.mat<-id_pts(grd = Mex0.grd, pts = mammals)

x.model <- NBModel(x.mat, target = 1:10, fac.lap = 0.01)

edelcallejoc/rspecies documentation built on May 27, 2019, 7:25 a.m.