View source: R/autoplot.vector.points.R
autoplot.vector.points | R Documentation |
autoplot.vector.points
creates a map of Vector points downloaded from MAP.
## S3 method for class 'vector.points'
autoplot(
object,
...,
shp_df = NULL,
admin_level = "admin0",
map_title = "Vector Survey Locations",
fill_legend_title = "Raw Vetor Occurrences",
fill_scale_transform = "identity",
facet = NULL,
printed = TRUE
)
object |
a vector.points object downloaded using |
... |
Other arguments passed to specific methods |
shp_df |
Shapefile(s) (data.frame) to plot with downloaded points. (If not specified automatically uses getShp() for all countries included in vector.points object). |
admin_level |
the administrative level used for plotting administrative boundaries; either |
map_title |
custom title used for the plot |
fill_legend_title |
Add a title to the legend. |
fill_scale_transform |
String givning a transformation for the fill aesthetic.
See the trans argument in |
facet |
if TRUE, splits map into a separate facet for each malaria species; by default FALSE. |
printed |
Should the plot be printed to the graphics device. |
autoplot.vector.points
returns a plots (gg object) for the supplied vector.points dataframe.
## Not run:
Vector_surveys_NGA_NG <- getVecOcc(country = c("Nigeria", "Niger"))
autoplot(Vector_surveys_NGA_NG)
# Download the predicted distribution of An. dirus species complex Raster and
# vector points for Myanmar and visualise these together on a map.
# Download Myanmar shapefile to use for raster download.
MMR_shp <- getShp(ISO = "MMR", admin_level = "admin0")
# Download An. dirus predicted distribution Raster & plot this
MMR_An_dirus <- getRaster(surface = "Anopheles dirus species complex", shp = MMR_shp)
p <- autoplot(MMR_An_dirus, shp_df = MMR_shp, printed = FALSE)
# Download raw occurrence points & plot these over the top of the raster
species <- getVecOcc(country = "Myanmar", species = "Anopheles dirus")
# p[[1]] +
# geom_point(data = species,
# aes(longitude,
# latitude,
# colour = species))+
# scale_colour_manual(values = "black", name = "Vector suvery locations")+
# scale_fill_distiller(name = "Predicted distribution of An. dirus complex",
# palette = "PuBuGn",
# direction = 1)+
# ggtitle("Vector Survey points\n + The predicted distribution of An. dirus complex")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.