emodnet_map_plot: Plot your spatial data following the EMODnet style

Description Usage Arguments Value Examples

View source: R/emodnet_map_plot.R

Description

Plot your spatial data following the EMODnet style

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
emodnet_map_plot(
  data,
  fill = NULL,
  title = NULL,
  subtitle = NULL,
  legend = NULL,
  crs = 3035,
  xlim = c(2426378.0132, 7093974.6215),
  ylim = c(1308101.2618, 5446513.5222),
  direction = 1,
  option = "viridis",
  zoom = FALSE,
  plot_polygon_border = TRUE,
  ...
)

Arguments

data

Data to be plotted in a map. Accepts sf, RasterLayer, "SpatialPolygonsDataFrame", "SpatialPointsDataFrame", "SpatialLinesDataFrame"

fill

column or vector used for filling in case of plotting a polygon.

title

Title of the plot.

subtitle

Subtitle of the plot.

legend

Legend of the values.

crs

Coordinate Reference System of the map. Default: LAEA Europe, EPGS:3035. Accepts EPGS and strings.

xlim

Vector with minimum and maximum longitude. Default to Europe scale.

ylim

Vector with minimum and maximum latitude. Default to Europe scale.

direction

Direction in which the scale colors are drawn. Default 1. Reverse with -1.

option

The color style used for the filling. Default "viridis". Try also "plasma"

zoom

If TRUE, the size of the plot is calculated from the bounding box of the data. Otherwise you should provide xlim and ylim to your desired size

plot_polygon_border

if TRUE, the border of the polygon will be drawn. Default is TRUE. Set to FALSE if you have small polygons compared to the size of the canvas.

...

params to be passed to emodnet_map_basic

Value

ggplot

Examples

1
2
3
4
5
6
7
aphiaid <- 107451
specname <- "Eriocheir sinensis"
Esgrid <- sf::st_read(paste0("http://geo.vliz.be/geoserver/wfs/ows?", "service=WFS&version=1.3.0&",
"request=GetFeature&", "typeName=Dataportal%3Aeurobis_grid_1d",
"-obisenv&", "viewParams=aphiaid%3A", aphiaid, "&", "outputFormat=json", "&maxFeatures=10"))
emodnet_map_plot(Esgrid, fill = Esgrid$RecordCount,  title = specname,
subtitle = paste("Aphiaid =", aphiaid), legend = "Abundance", plot_polygon_border = TRUE)

EMODnet/EMODnetBiologyMaps documentation built on Aug. 12, 2021, 7:47 p.m.