Learn R Programming

rdwd (version 1.3.1)

plotRadar: plot radar products on a pretty map

Description

Convenience function to plot radar products on a pretty map. Creates a separate plot for each layer, a selection is possible.

Usage

plotRadar(
  x,
  layer = NULL,
  main = "",
  land = "gray80",
  sea = "cadetblue1",
  de = "grey80",
  eu = "black",
  xlim = NULL,
  ylim = NULL,
  project = TRUE,
  proj = "radolan",
  extent = "radolan",
  targetproj = "ll",
  quiet = FALSE,
  ...
)

Arguments

x

raster oject, e.g. 'dat' element of object returned by readDWD.

layer

Optional: selected layer(s) to be plotted. DEFAULT: NULL

main

Graph title(s). DEFAULT: ""

land

Color of land areas in the map. DEFAULT: "gray80"

sea

Color of sea areas in the map. DEFAULT: "cadetblue1"

de

Color of Deutschland Bundesland borders. DEFAULT: "grey80"

eu

Color of Europe country borders. DEFAULT: "black"

xlim

xlim. DEFAULT: NULL, i.e. taken from x extent (after reprojection if project=TRUE)

ylim

ylim. DEFAULT: NULL, i.e. taken from y extent (after reprojection if project=TRUE)

project

Project the data before plotting? Not needed if projectRasterDWD has already been called. DEFAULT: TRUE

proj

current projection, see projectRasterDWD, used only if project=TRUE. DEFAULT: "radolan"

extent

current extent, see projectRasterDWD, used only if project=TRUE. DEFAULT: "radolan"

targetproj

target projection, see projectRasterDWD, used only if project=TRUE. DEFAULT: "ll"

quiet

suppress progress messages? DEFAULT: FALSE

Further arguments passed to raster::plot

Value

raster object, projected (if project=TRUE). If length(layer)==1, only that selected layer is returned. If main is non-empty, it is added to x@title.

See Also

readDWD, https://bookdown.org/brry/rdwd/raster-data.html

Examples

Run this code
# NOT RUN {
# See homepage in the section 'See Also'
# }
# NOT RUN {
 ## Excluded from CRAN checks: requires internet connection
link <- "seasonal/air_temperature_mean/16_DJF/grids_germany_seasonal_air_temp_mean_188216.asc.gz"
rad <- dataDWD(link, base=gridbase, joinbf=TRUE, dir=tempdir())
plotRadar(rad, proj="seasonal", extent=rad@extent)
plotRadar(rad, ylim=c(52,54), proj="seasonal", extent=rad@extent)
plotRadar(rad)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab