Description Usage Arguments Author(s) Examples
Based on the addCovariates function from secr but which also accommodates SpatialPointsDataFrame data objects.
1 | add_covariates(x, data)
|
x |
a gmask or gcapthist object. |
data |
a gshp object |
Darren Kidney darrenkidney@googlemail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
library(secr)
library(ggplot2)
data(N.annamensis)
mask = make_mask(N.annamensis.capthist, spacing = 250, buffer = 6000)
head(covariates(mask[[1]]))
ggplot() + coord_fixed() +
geom_mask(mask) +
geom_capthist(N.annamensis.capthist) +
labs(x = "Longitude", y = "Latitude")
mask = add_covariates(mask, N.annamensis.habitat)
head(covariates(mask[[1]]))
ggplot() + coord_fixed() +
geom_mask(mask, covariate = "habitat") +
geom_capthist(N.annamensis.capthist) +
scale_fill_manual(values = c("darkgreen", "lightgreen")) +
labs(x = "Longitude", y = "Latitude")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.