rangeMapper (version 0.3-1)

plot,rmap.frame,missing-method: Plot a rmap.frame

Description

Plot a rmap.frame

Usage

# S4 method for rmap.frame,missing
plot(x, colours = palette_rangemap("set1"),
  outlierDetector, boundary, boundaryCol = 1, boundarySize = 0.5, ...)

Arguments

x

a rmap.frame object.

colours

a vector of colours to pass to scale_fill_gradientn.

outlierDetector

a function used to detect ouliers. Should return lower and upper limits of non-outliers.

boundary

a Spatial* object which can be fortifyed.

boundaryCol

boundary color, see geom_polygon.

boundarySize

boundary size, geom_polygon.

further arguments to pass to arrangeGrob.

Value

a ggplot object for one map or a gtable in case of more than one map.

See Also

plot,SpatialPixelsRangeMap,missing-method

Examples

Run this code
# NOT RUN {
breding_ranges = rgdal::readOGR(system.file(package = "rangeMapper",
     "extdata", "wrens", "vector_combined"), "wrens", verbose = FALSE)
data(wrens)
d = subset(wrens, select = c('sci_name', 'body_mass', 'clutch_size') )
con = ramp("wrens.sqlite", gridSize = 1, spdf = breding_ranges, biotab = d, ID = "sci_name",
            FUN = "median", overwrite = TRUE)
m = rangeMap.fetch(con, c('median_body_mass', 'median_clutch_size'), spatial = FALSE)
plot(m, ncol = 2)

wrens_boundary = rgeos::gUnionCascaded(breding_ranges)
plot(m, ncol = 2, boundary = wrens_boundary)

# }
# NOT RUN {
if(require(extremevalues))
plot(m, ncol = 2, outlierDetector = function(x) getOutliersI(x)$limit)
# }

Run the code above in your browser using DataLab