plot.sampbias: Mapping Occurrence and Bias Rasters in an Object of the Class...

Description Usage Arguments Value Note See Also Examples

View source: R/plot.sampbias.R

Description

Plotting method for class sampbias, generating a rasterized plots showing the number of occurrences and the number of species per gridcell, one bias raster indicating the efect strenth for each gazetteer provided to SamplingBias, and a average bias raster indicating the average bias for each gridcell.

Usage

1
2
## S3 method for class 'sampbias'
plot(x, gaz = NULL, sealine = T, ...)

Arguments

x

an object of the class sampbias.

gaz

a list of SpatialObjects, to be printed on the maps. Should be the same objects provided to SamplingBias when creating the Object. If gaz is not supplied, the sampbias package standard gazetteers are used.

sealine

logical. Should the sealine be added to the plots? Default is to TRUE.

...

Additional arguments to be passed to plot.

Value

A series of R plots based on ggplot2.

Note

Check https://github.com/azizka/sampbias/wiki for a tutorial on sampbias.

See Also

SamplingBias, summary.sampbias

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#simulate data
occ <- data.frame(species = rep(sample(x = LETTERS, size = 5), times = 10),
                  decimallongitude = runif(n = 50, min = -5, max = 5),
                  decimallatitude = runif(n = 50, min = -4, max = 4))


#create point gazetteer
pts <- data.frame(long = runif(n = 5, min = -5, max = 5),
                  lat = runif(n = 5, min = -4, max = 4),
                  dat = rep("A", 5))
pts <- SpatialPointsDataFrame(coords = pts[,1:2], data = data.frame(pts[,3]))

lin <- data.frame(long = seq(-5, 5, by = 1),
                  lat = rep(2, times = 11))
lin <- SpatialLinesDataFrame(sl = SpatialLines(list(Lines(Line(lin), ID="B1"))),
                             data = data.frame("B", row.names = "B1"))

gaz <- list(lines.strucutre = lin, point.structure = pts)

out <- SamplingBias(x = occ, gaz = gaz, terrestrial = FALSE)
plot(out)

azizka/sampbias documentation built on June 4, 2017, 12:07 a.m.