Description Usage Arguments Value See Also Examples
getRaster
downloads publicly available MAP rasters for a specific surface & year, clipped to a provided bounding box or shapefile.
1 2 3 4 5 6 7 8 |
surface |
string containing 'title' of desired raster(s), e.g. |
shp |
SpatialPolygon(s) object of a shapefile to use when clipping downloaded rasters. (use either |
extent |
2x2 matrix specifying the spatial extent within which raster data is desired, as returned by sp::bbox() - the first column has the minimum, the second the maximum values; rows 1 & 2 represent the x & y dimensions respectively (matrix(c("xmin", "ymin","xmax", "ymax"), nrow = 2, ncol = 2, dimnames = list(c("x", "y"), c("min", "max")))) (use either |
file_path |
string specifying the directory to which working files will be downloaded. Defaults to tempdir(). |
year |
default = |
vector_year |
default = |
getRaster
returns a RasterLayer (if only a single raster is queried) or RasterStack (for multiple rasters) for the specified extent.
to quickly visualise rasters downloded using getRaster
.
to convert RasterLayer/RasterStack objects into a 'MAPraster' object (data.frame) for easy plotting with ggplot.
to quickly visualise MAPraster objects created using /codeas.MAPraster.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Download PfPR2-10 Raster for Madagascar in 2015 and visualise this immediately.
MDG_shp <- getShp(ISO = "MDG", admin_level = "admin0")
MDG_PfPR2_10 <- getRaster(surface = "Plasmodium falciparum PR2-10", shp = MDG_shp, year = 2015)
autoplot_MAPraster(MDG_PfPR2_10)
# Download global raster of G6PD deficiency from Howes et al 2012.
G6PDd_global <- getRaster(surface = "G6PD Deficiency Allele Frequency")
autoplot_MAPraster(G6PDd_global)
# Download a temporal raster by range
MDG_PfPR2_10_range <- getRaster(surface = "Plasmodium falciparum PR2-10",
shp = MDG_shp, year = 2012:2015)
# Download a mix of rasters
MDG_rasters <- getRaster(surface = c("Plasmodium falciparum PR2-10",
'Plasmodium falciparum Incidence',
'Plasmodium falciparum Support'),
shp = MDG_shp, year = list(2009:2012, 2005:2007, NA))
p <- autoplot_MAPraster(MDG_rasters)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.