Description Usage Arguments Value Slots Author(s) References See Also Examples
SpNaBaMatrix is used to fit Spatial Naive Bayes models. It can be used to extract information of the sample and to adjust Spatial Naive Bayes models.
1 | SpNaBaMatrix(freqmatrix, ...)
|
freqmatrix |
|
... |
argument pass to other methods. |
An object of class SpNaBaMatrix
. See slot section for more details.
freqmatrix
matrix
. A matrix with $N$ rows (rows correspond to the number of blocks
in the GRID) and $M$ columns (columns represent the number of factors included in the model),
where each element $i,j$ shows the number of observations of the factor $j$ in the cell $i$.
binmatrix
matrix
. A matrix with $N$ rows (rows correspond to the number of blocks
in the GRID) and $M$ columns (columns represent the number of factors included in the model),
where each element $i,j$ shows TRUE
if the cell $i$ contains at least one observation
of the factor $j$. FALSE
otherwise.
Enrique Del Callejo Canal (edelcallejoc@gmail.com), based on implemented algortihms in web platform SPECIES (see References).
http://species.conabio.gob.mx/
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 27 | # Using SpNaBaMatrix constructor ----------------------
a <- matrix(rbinom(100, 100, runif(100)), nrow = 10, ncol = 10,
dimnames = list(paste0("id:", 1:10), letters[1:10]))
x.mat <- SpNaBaMatrix(freqmatrix = a)
x.mat
# Using the function id_pts() for spatial data --------
library(sp)
library(rgeos)
library(rgdal)
library(raster)
# Loading data
data(Mex0)
data(mammals)
# Generating de grid from Mex0 data
Mex0.grd<-grd_build(Mex0)
# Identification points of mammals
x.mat<-id_pts(grd = Mex0.grd, pts = mammals)
x.mat
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.