Description Usage Arguments Author(s) See Also Examples
Plotting functions for gibbonsecr mask objects. The plot method
is a wrapper for plot.mask and geom_mask is a wrapper for
geom_point (or geom_contour when
contour = TRUE
)
1 2 3 4 |
x |
a gmask object |
covariate |
name of covariate to use for colouring |
sessions |
sessions to plot (as integer indices, logical indices or session names) |
... |
additional arguments to pass to plot.mask or geom_point |
contour |
if |
Darren Kidney darrenkidney@googlemail.com
plot.gcapthist
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 | ## Not run:
data(N.annamensis)
mask = N.annamensis.mask
capthist = N.annamensis.capthist
# plot methods -----------------------------------------------------------------
par(mar = c(2,2,1,1))
plot(mask)
points(capthist, cex = 0.5)
plot(mask, covariate = "x", legend = FALSE)
points(capthist, cex = 0.5)
plot(mask, covariate = "y", legend = FALSE)
points(capthist, cex = 0.5)
plot(mask, covariate = "habitat", legend = FALSE)
points(capthist, cex = 0.5)
# ggplot methods ---------------------------------------------------------------
library(ggplot2)
ggplot() + coord_fixed() +
geom_mask(mask) +
geom_capthist(capthist) +
labs(x = "Longitude", y = "Latitude")
ggplot() + coord_fixed() +
geom_mask(mask, covariate = "x") +
geom_capthist(capthist) +
scale_fill_distiller(palette = "Spectral") +
labs(x = "Longitude", y = "Latitude", fill = "Longitude")
ggplot() + coord_fixed() +
geom_mask(mask, covariate = "y") +
geom_capthist(capthist) +
scale_fill_distiller(palette = "Spectral") +
labs(x = "Longitude", y = "Latitude", fill = "Latitutde")
ggplot() + coord_fixed() +
geom_mask(mask, covariate = "habitat") +
geom_capthist(capthist) +
scale_fill_manual(values = c("darkgreen", "lightgreen")) +
labs(x = "Longitude", y = "Latitude", fill = "habitat")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.