spsite: spsite

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Generates a diversity data.frame, with the number occurrences of taxa per locality or a presence/absence data.frame.

Usage

1
spsite(data, unity, res = 1, rank = "genus", pa = FALSE)

Arguments

data

data.frame. Fossil occurrences data.

unity

character. If the user wants the occurrences per cell (unity = "cell") or per fossilsite (unity = "fossilsite).

res

numeric. The spatial resolution. Only used if unity = "cell". By default res = 1.

rank

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

pa

boolean. Defines if the user wants presence/absence or counted data. By default pa = FALSE, which means the function returns counted data.

Value

data.frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## 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
sp_fossilsite <- spsite(data = df_auto, unity = "fossilsite", rank = "species", res = 10)
sp_cell <- spsite(data = df_auto, unity = "cell", rank = "species", res = 10)



## End(Not run)

macroecology/paleoMap documentation built on March 2, 2020, 1:47 p.m.