autoplot.vector.points: Create a basic plot showing locations of downloaded Vector...

View source: R/autoplot.vector.points.R

autoplot.vector.pointsR Documentation

Create a basic plot showing locations of downloaded Vector points

Description

autoplot.vector.points creates a map of Vector points downloaded from MAP.

Usage

## 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
)

Arguments

object

a vector.points object downloaded using getVecOcc

...

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 "admin0"; "admin1" OR "both"

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 continuous_scale for possible values.

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.

Value

autoplot.vector.points returns a plots (gg object) for the supplied vector.points dataframe.

Examples

## 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)


malariaAtlas documentation built on Oct. 27, 2023, 9:07 a.m.