SpNaBaMatrix-class: Class SpNaBaMatrix

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

Description

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.

Usage

1
SpNaBaMatrix(freqmatrix, ...)

Arguments

freqmatrix

matrix. typically, the output of id_pts() function. See slots section for more details.

...

argument pass to other methods.

Value

An object of class SpNaBaMatrix. See slot section for more details.

Slots

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.

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

grd_build and id_pts.

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
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

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