latdivgrad: latdivgrad

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Calculates the latitudinal diversity of taxa (species, genera, ...) and creates a plot of the paleogeographical continental masses with the fossil occurrences and the latitudinal diversity.

Usage

1
2
3
4
5
6
latdivgrad (data, method, rank = "genus",
                        res = 1, map = NULL, model = "SETON2012",
                        colland = "#66666680", colsea = "#00509010", 
                        colpoints = "#65432190",
                        rich.col = "#654321", pch = 21, 
                        do.plot = TRUE, save.as = NULL,...)

Arguments

data

data.frame. Fossil occurrence data.

method

character. The method of diversity measure, method = "shannon" or method = "richness". Must be defined by the user.

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.

map

(list of) SpatialPolygonDataFrame(s). Containing map(s) which can be created with the function mapast::getmap(ma, model).

model

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

colland

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

colsea

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

colpoints

character. The color of the fossil occurrence-points. By default colpoints = "#65432190".

rich.col

character. The color of the richness curve. By default rich.col = "#654321".

pch

numeric. Point symbol for plotting the occurences. By default pch = 21.

do.plot

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

save.as

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

...

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

data.frame

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
26
27
28
29
30
31
32
## 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
latrich <- latdivgrad(data = df_auto, method = "richness", rank = "species", res = 1,
                      model = "SETON2012")
latdiv <- latdivgrad(data = df_auto, method = "shannon", rank = "species", res = 1,
                      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)
latdivgrad(data = df_auto, method = "richness", rank = "species", res = 1, map = maps,
                      model = "SETON2012")
latdivgrad(data = df_auto, method = "shannon", rank = "species", res = 1, map = maps,
                      model = "SETON2012")

#save maps with latitudinal diversity as pdf
latdivgrad(data = df_auto, method = "richness", rank = "species", res = 1, map = maps,
                      model = "SETON2012", save.as = "pdf")
latdivgrad(data = df_auto, method = "shannon", rank = "species", res = 1, map = maps,
                      model = "SETON2012", save.as = "pdf")

## End(Not run)

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