Learn R Programming

bioRad (version 0.7.1)

download_basemap: Download a basemap for map(ppi)

Description

Downloads a basemap for map.ppi() from Stamen Maps or Google Maps using ggmap::get_map(). To use Google Maps as source, you will have to register with Google, enable billing and provide an API key to ggmap. See the ggmap README for details.

Usage

download_basemap(
  x,
  verbose = TRUE,
  zoom,
  alpha = 1,
  source = "stamen",
  maptype = "terrain",
  ...
)

Value

A ggmap object for map(ppi)

Arguments

x

A ppi object.

verbose

Logical. When TRUE, prints information to console.

zoom

Integer. Optional zoom level from 3 (continent) to 21 (building), see ggmap::get_map(). When undefined, the zoom level will be the one matching the ppi extent.

alpha

Numeric. Transparency of the basemap, value between 0 and 1.

source

Character. Map service to be used: stamen or google.

maptype

Character. Type of basemap to plot. For Stamen Maps: terrain, terrain-background, terrain-labels, terrain-lines, toner, toner-2010, toner-2011, toner-background, toner-hybrid, toner-labels, toner-lines, toner-lite or watercolor. For Google Maps: terrain, satellite, roadmap or hybrid.

...

Arguments to pass to ggmap::get_map().

See Also

  • map.ppi()

Examples

Run this code
# Project a scan as a ppi
ppi <- project_as_ppi(example_scan)
# \donttest{
# Create a basemap that matches the extent of the ppi
basemap <- download_basemap(ppi)

# Map the radial velocity of the ppi onto the basemap
map(ppi, map = basemap, param = "VRADH")

# Increase the transparency of the basemap
basemap <- download_basemap(ppi, alpha = 0.3)
map(ppi, map = basemap, param = "VRADH")

# Download a different type of basemap, e.g. a gray-scale image.
# See get_map() in ggmap library for full documentation of the options.
basemap <- download_basemap(ppi, maptype = "toner-lite")
map(ppi, map = basemap, param = "VRADH")
# }

Run the code above in your browser using DataLab