mapocc: mapocc

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Creates a RasterLayer, containing the number of occurrences per cell and a plot of the fossil occurrences by the taxonomic rank per cell (a proxy for the sampling effort).

Usage

1
2
3
4
5
mapocc(data, model = "SETON2012",
                   rank = "genus", map = NULL,
                   res = 1, save.as = NULL,
                   colland = "#66666660",
                   colsea = "#00509010", col.grid = mycols(100), do.plot = TRUE, ...)

Arguments

data

data.frame. Fossil occurrences data.

model

character. The model the map should be created with. "SETON2012" (default), "MULLER2016", "GOLONKA", "PALEOMAP" or "MATTHEWS2016".

rank

character. The taxonomic rank of interest. "species", "genus", "family", "order", "class" or "phylum". By default rank = "genus".

map

(list of) SpatialPolygonDataFrames. Containing map(s) which can be created by mapast::getmap(ma, model).

res

numeric. The spatial resolution. By default res = 1.

save.as

character. The format the plots should be saved. "tiff", "pdf", "jpeg" or "png".

colland

character. The color of the land masses. By default colland = "#66666660".

colsea

character. The color of the sea. By default colsea = "#00509010".

col.grid

character. The color of the raster. By default col.grid = mycols(100),

do.plot

logical. If a plot is created or not. By default do.plot = TRUE.

...

Graphical parameters. Any argument that can be passed to image.plot and to plot, such as main = "my own title" or main.col = "red".

Value

RasterLayer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 

library(mapast)

# get data and preprocess it
data  <-  base::data.frame(paleobioDB::pbdb_occurrences(base_name = "Canis", 
                                                        min_ma = 0, max_ma = 10, 
                                                        show = c("coords", "phylo"), 
                                                        vocab = "pbdb", limit = 100))
df <- formatdata(data = data)
df_auto <- paleocoords(data = df, time = "automatic")
                                                        
# create a plot with fossils on the paleogeographical map
occras <- mapocc(data = df_auto, model = "SETON2012", rank = "species")

# save the maps before so the function does not need to load them
maps <- getmap(ma = 2.5, model = "SETON2012", do.plot = FALSE)
mapocc(data = df_auto, model = "SETON2012", rank = "species", map = maps)

# save maps as pdf
mapocc(data = df_auto, model = "SETON2012", rank = "species", map = maps, save.as = "pdf")


## End(Not run)

macroecology/mapast documentation built on March 1, 2020, 8:52 a.m.