R语言【paleobioDB】——pbdb_map_richness():通过化石分布记录,创建一个RasterLayer对象,和一个显示科、属、种等分类阶元丰富度的图

  Package paleobioDB version 0.7.0

paleobioDB 包在2020年已经停止更新,该包依赖PBDB v1 API。

可以选择在Index of /src/contrib/Archive/paleobioDB (r-project.org)下载安装包后,执行本地安装。


Usage

pbdb_map_richness (data, rank="species", do.plot=TRUE, res=5,
col.int="white", col.ocean="black",
col.rich=c("light blue","blue"),...)

Arguments

参数【data】:输入的数据,数据帧格式。可以通过 pbdb_occurrences() 函数 传参 show = c("phylo", “coords”, "ident") 获得数据。

参数【rank】:设置计算丰富度的分类阶元。可选项包括:“species”,“genus”,“family”,“order”,“class” 和 “phylum”

参数【do.plot】:逻辑值。如果为 TRUE,返回一个 RasterLayer 和一个图像。

参数【res】RasterLayer 对象的分辨率(以度为单位)。详见 raster

参数【col.int】:大陆的颜色。

参数【col.ocean】:大洋的颜色。

参数【col.rich】:两种及以上颜色。用来在地图上通过渐变色展示丰富度。

参数【...】:其他参数。详见 parmap


Details

使用 pdbd_occurrences() 函数时必须传入 show=“coords”


Value

返回一个 RasterLayer 对象,和一个显示分类等级丰富度的图像。RasterLayer 对象的分辨率由 参数【res】 控制。默认的分辨率为 1


Example

data<- pbdb_occurrences (limit=1000, vocab= "pbdb", base_name="mammalia",
show=c("phylo","coords","ident"))
X11(width=13, height=7.8)
pbdb_map_richness (data,res=8,rank="genus")
pbdb_map_richness (data,res=8,rank="family")
## to obtain the raster file and not plot the map
pbdb_map_richness (data,res=8,rank="family",do.plot=F)

Page

function (data, rank = "species", do.plot = TRUE, res = 5, col.int = "white", 
    col.ocean = "black", col.rich = c("light blue", "blue"), 
    ...) 
{
    if (!any(rank == c("species", "genus", "family", "order", 
        "class", "phylum"))) {
        stop("Invalid rank name. Use: \"species\", \"genus\", \"family\", \"order\", \"class\" or \"phylum\".\n             See \"pbdb_map_richness\" help page")
    }
    if (sum(colnames(data) %in% c("lat", "lng", "genus", "family", 
        "order", "class", "phylum", "mid", "fml", "odl", "cll", 
        "phl")) != 7) {
        stop("Invalid data input. Use in \"pbdb_occurrences\" function the argument: show=c(\"phylo\",\"coords\",\"ident\"). e.g. pbdb_occurrences(..., show=c(\"phylo\",\"coords\",\"ident\")).\n             See \"pbdb_map_richness\" help page")
    }
    if (rank == "species") {
        r <- .extract.rank.specie(data, res)
    }
    else {
        r <- .extract.rank.all(data, res, rank)
    }
    if (do.plot == TRUE) {
        .plot.Raster.rich(r, col.rich, col.ocean, col.int, res, 
            ...)
        mtext(paste("Richness of", rank), 4, line = -1, cex = 2)
    }
    r
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ALittleHigh

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值