plot_shp: Plot an imported shapfile

Description Usage Arguments Author(s) Examples

Description

Plotting methods for imported shapefiles.

Usage

1
2
3
4
## S3 method for class 'gshp'
plot(x, covariate = NULL, contour = FALSE, ...)

geom_shp(x, covariate = NULL, contour = FALSE, ...)

Arguments

x

a gshp object

covariate

name of covariate to use for colouring

contour

if TRUE, contour lines will be plotted

...

additional arguments to be passed to the underlying plotting method (see Details)

Author(s)

Darren Kidney darrenkidney@googlemail.com

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
## Not run: 

data(N.annamensis)

# plot methods -----------------------------------------------------------------

plot(N.annamensis.region, col = "grey")

plot(N.annamensis.habitat, covariate = "habitat", col = c("darkgreen", "lightgreen"))
plot(N.annamensis.region, add = TRUE)

# ggplot methods ---------------------------------------------------------------

library(ggplot2)

ggplot() + coord_fixed() +
    geom_shp(N.annamensis.region)

ggplot() + coord_fixed() +
    geom_shp(N.annamensis.habitat, covariate = "habitat") +
    scale_fill_manual(values = c("darkgreen", "lightgreen"))

ggplot() + coord_fixed() +
    geom_shp(N.annamensis.habitat, covariate = "habitat") +
    geom_shp(N.annamensis.region) +
    scale_fill_manual(values = c("darkgreen", "lightgreen"))

## End(Not run)

dkidney/gibbonsecr documentation built on May 15, 2019, 9:11 a.m.