Learn R Programming

rice (version 1.1.1)

map.shells: Plot regional shell-derived dR values

Description

Find the shells that fit within a rectangular region (bounded by N, E, S and W), and plot the dR values and feeding ecology. Uses the marine database downloaded (30 Aug 2024) from calib.org/marine. See Reimer PJ, Reimer RW, 2001. A marine reservoir correction database and on-line interface. Radiocarbon 43:461-3. Expects the coordinates for the map to be provided (starting south, then clockwise as with R axes).

Usage

map.shells(
  S = 48,
  W = -15,
  N = 62,
  E = 5,
  colour = "dR",
  rainbow = FALSE,
  size = 2,
  mapsize = "large",
  mincol = "yellow",
  maxcol = "red",
  symbol = "feeding",
  symbol.legend = TRUE,
  ocean.col = "aliceblue",
  land.col = rgb(0, 0.5, 0, 0.6),
  legend.loc = c(0.95, 0.02),
  legend.size = c(0.05, 0.2),
  padding = 0.1,
  warn = TRUE
)

Value

A plot and the relevant dR values.

Arguments

S

The southern limit of the rectangular region.

W

The western limit of the rectangular region.

N

The northern limit of the rectangular region.

E

The eastern limit of the rectangular region.

colour

The variable to be plotted as colour. Expects a continuous variable. Defaults to 'dR'.

rainbow

Whether or not to use a rainbow scale to plot the variable.

size

Size of the symbols. Defaults to 2.

mapsize

Resolution of the map. Can be "small" or "large". If the latter, a high-resolution dataset will have to be downloaded using the R package 'rnaturalearthhires'. Since this package is on github but not on CRAN, you will have to download it yourself (using the command devtools::install_github("ropensci/rnaturalearthhires")). Defaults to "small" if 'rnaturalearthhires' is not installed, and to "large" if it is installed.

mincol

Colour for minimum values.

maxcol

Colour for maximum values.

symbol

The variable to be plotted as symbol. Expects a categoric variable. Defaults to 'feeding'.

symbol.legend

Whether or not to plot the legend for the symbols.

ocean.col

Colour for the oceans. Defaults to ocean.col="aliceblue".

land.col

Colour for the land. Defaults to semi-transparent darkgreen: land.col=rgb(0, 0.5, 0, 0.6).

legend.loc

Location of the legend, if using a basic plot. Defaults to the bottom right corner based on par("usr"), legend.loc=c(0.95, 0.02)

legend.size

Size of the legend, if using a basic plot. Defaults to legend.size=c(0.05, 0.2)

padding

Area around the map if using a basic plot. Avoids strange line features. Defaults to padding=0.1.

warn

Whether or not to warn if some recommended are not available.

Details

This function uses the `rnaturalearth` package for country maps. If the high-resolution maps are desired, the `rnaturalearthhires` package must be installed from GitHub.

Examples

Run this code
 N_UK <- map.shells(53, -11, 60, 2, mapsize="small")
 mean(N_UK$dR)

Run the code above in your browser using DataLab