maprich: maprich

Description Usage Arguments Value Examples

Description

Creates a RasterLayer of taxon richness and makes a plot of the map with the richness raster.

Usage

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

Arguments

data

data.frame. Fossil occurrences data.

rank

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

res

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

model

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

map

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

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
25
## 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
rich <- maprich(data = df_auto, rank = "species", res = 10, model = "SETON2012")

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

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


## End(Not run)

macroecology/pasta documentation built on March 1, 2020, 11:22 p.m.