get-methods: Accesor methods for SpNaBa-objects

Description Usage Arguments Value Author(s) See Also Examples

Description

get_ functions are methods to extract slot from SpNaBaMatrix, SpNaBaCounts, SpNaBaProbs objects. The accesor functions are build in with a snake style; i.e. get_suffix, where the suffix are de abbreciation of the slot to extract. For example, the suffix FM (get_FM()) stands to refer the freqmatrix slot of the SpNaBaMatrix object. In the same way, the suffix BM (get_BM()) stands to refer the binmatrix of the SpNaBaMatrix object.

Usage

 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
get_FM(x.mat)

get_BM(x.mat)

get_N(x.counts)

get_Nc(x.counts)

get_Nx(x.counts)

get_Ncx(x.counts)

get_Pc(x.probs)

get_Px(x.probs)

get_Pcx(x.probs)

get_Pxc(x.probs)

get_Pxnc(x.probs)

get_Ecx(x.eps)

get_Apriori(x.score)

get_Scx(x.score)

Arguments

x.mat

A SpNaBaMatrix or SpNaBaModel object.

x.counts

A SpNaBaCounts object or SpNaBaModel object.

x.probs

A SpNaBaProbs object or SpNaBaModel object.

x.eps

A SpNaBaEps object, the resulting object of epsilon function or A SpNaBaModel object. The resulting object of NBModel function.

x.score

A SpNaBaScore object. The resulting object of score function or A SpNaBaModel object. The resulting object of NBModel function.

Value

get_FM return the slot freqmatrix a SpNaBaMatrix object.

get_BM return the slot binmatrix a SpNaBaMatrix object.

get_N return the slot N a SpNaBaCounts object.

get_Nc return the slot Nc a SpNaBaCounts object.

get_Nx return the slot Nx a SpNaBaCounts object.

get_Ncx return the slot Ncx a SpNaBaCounts object.

get_Pc return the slot Pc a SpNaBaProbs object.

get_Px return the slot Px a SpNaBaProbs object.

get_Pcx return the slot Pc.x a SpNaBaProbs object.

get_Pxc return the slot Px.c a SpNaBaProbs object.

get_Pxnc return the slot Px.nc a SpNaBaProbs object.

get_Ecx return the slot Ecx of a SpNaBaEps object.

get_Apriori return the slot Apriori a SpNaBaScore object.

get_Scx return the slot Scx of a SpNaBaScore object.

Author(s)

Enrique Del Callejo Canal ([email protected]).

See Also

SpNaBaMatrix

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
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
# 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)

# Extracting Frequqency matrix

FM <- get_FM(x.mat)

FM[1:5,1:5]

# Extracting Binary matrix

BM <- get_BM(x.mat)

BM[1:5,1:5]

# Calculating counts

x.counts <- counts(x.mat)

# Extracting N

N <- get_N(x.counts)
N

# Extracting Nc

Nc <- get_Nc(x.counts)
Nc

# Extracting Nx

Nx <- get_Nx(x.counts)
Nx

# Extracting Ncx

Ncx <- get_Ncx(x.counts)
Ncx

# Calculating probabilities

x.probs <- probs(x.counts, fac.lap = 0.1)

# Extracting Pc

Pc <- get_Pc(x.probs)
Pc

# Extracting Px

Px <- get_Px(x.probs)
Px

# Extracting Pc.x

Pc.x <- get_Pcx(x.probs)
Pc.x

# Extracting Px.c

Px.c <- get_Pxc(x.probs)
Px.c

# Extracting Px.nc

Px.nc <- get_Pxnc(x.probs)
Px.nc

# Calculating epsilon

x.eps <- epsilon(x.counts, x.probs)


# Extracting Epsilon matrix

Ecx <- get_Ecx(x.eps)

Ecx[1:5,1:5]

# Calculating score

x.score <- score(x.probs)


# Extracting Apriori slot

S.Apriori <- get_Apriori(x.score)

S.Apriori[1:5]

# Extracting Score matrix

Scx <- get_Scx(x.score)

Scx[1:5, 1:5]

edelcallejoc/rspecies documentation built on Dec. 17, 2018, 9:15 a.m.