autoplot.MAPraster: Quickly visualise Rasters downloaded from MAP

View source: R/autoplot.MAPraster.R

autoplot.MAPrasterR Documentation

Quickly visualise Rasters downloaded from MAP

Description

autoplot.MAPraster creates a map of all rasters in a MAPraster object and displays these in a grid.

Usage

## S3 method for class 'MAPraster'
autoplot(
  object,
  ...,
  shp_df = NULL,
  legend_title = "",
  plot_titles = TRUE,
  fill_scale_transform = "identity",
  fill_colour_palette = "RdYlBu",
  printed = TRUE
)

Arguments

object

MAPraster object to be visualised.

...

Other arguments passed to specific methods

shp_df

Shapefile(s) (data.frame) to plot with downloaded raster.

legend_title

String used as title for all colour scale legends.

plot_titles

Plot name of raster object as header for each individual raster plot?

fill_scale_transform

String givning a transformation for the fill aesthetic. See the trans argument in continuous_scale for possible values.

fill_colour_palette

String referring to a colorbrewer palette to be used for raster colour scale.

printed

Logical vector indicating whether to print maps of supplied rasters.

Value

autoplot.MAPraster returns a list of plots (gg objects) for each supplied raster.

See Also

getRaster:

to download rasters directly from MAP.

as.MAPraster:

to convert RasterLayer/RasterStack objects into a 'MAPraster' object (data.frame) for easy plotting with ggplot.

autoplot.MAPraster:

to quickly visualise MAPraster objects created using as.MAPraster.

Examples

## Not run: 
# Download PfPR2-10 Raster (Bhatt et al 2015) and raw survey points
#   for Madagascar in 2013 and visualise these together on a map.

# Download madagascar shapefile to use for raster download.
MDG_shp <- getShp(ISO = "MDG", admin_level = "admin0")

# Download PfPR2-10 Raster for 2013 & plot this
MDG_PfPR2_10 <- getRaster(surface = "Plasmodium falciparum PR2-10", 
                          shp = MDG_shp, year = 2013)
p <- autoplot(MDG_PfPR2_10, shp_df = MDG_shp)

# Download raw PfPR survey points & plot these over the top of the raster
pr <- getPR(country = c("Madagascar"), species = "Pf")

# Download global raster of G6PD deficiency (Howes et al 2012) and visualise this on a map.
G6PDd_global <- getRaster(surface = "G6PD Deficiency Allele Frequency")
autoplot(G6PDd_global)

## End(Not run)


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