plot-predict: An S4 method for SpatialPolygonsDataFrame and SpNaBaPred...

Description Usage Arguments Value Author(s) Examples

Description

A plot methods for classes "SpatialPolygonsDataFrame" and "SpNaBaPred".

Usage

1
plot_predict(map, prediction, target = NULL, ...)

Arguments

map

A SpatialPolygonsDataFrame object from grd_build function.

prediction

A SpNaBaPred object from predict function.

target

logical, character, numeric or NULL. A vector with names, position (integer or boolean) that especifies the columns of the target variables. If length = 1, the prediction map for the target is displayed. If length > 1, the prediction richness map of the targets is displayed.

...

Parameters passed to other functions (See par).

Value

a ggplot object

Author(s)

Enrique Del Callejo Canal ([email protected]).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(sp)
library(rgeos)
data(Mex0)
data(mammals)

# Generating de grid from Mex0 data
Mex0.grd<-grd_build(Mex0)

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

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

# Calculando la predicción
x.prediction <- predict(x.model, apr_inc = FALSE)

# Plot of one target
plot_predict(Mex0.grd, x.prediction, target = 1)

# plot prediction of richness
plot_predict(Mex0.grd, x.prediction, target = 1:10)

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