R语言【paleobioDB】——pbdb_map_occur():通过化石分布记录,创建一个RasterLayer对象,和一个显示取样力度的图

本文介绍了paleobioDB0.7.0版本的使用,包括如何下载、安装及通过pbdb_map_occur函数创建化石记录地图,详细说明了函数参数和示例用法。
摘要由CSDN通过智能技术生成

  Package paleobioDB version 0.7.0

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

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


Usage

pbdb_map_occur (data, res=5, col.int="white", col.ocean="black",
col.eff=c("light blue","blue"), do.plot=TRUE, ...)

Arguments

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

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

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

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

参数【col.eff】:两种及以上颜色。用来在地图上通过渐变色展示化石记录点。

参数【do.plot】:逻辑值。为 TRUE 时,此函数返回一个 RasterLayer 对象和一个图像。

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


Details

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


Value

返回一个 RasterLayer 对象,还有一个显示取样力度(每个栅格中化石记录数量)的图像。RasterLayer 对象的分辨率由 参数【res】 控制。默认的分辨率为 1


Example

data<- pbdb_occurrences (limit="all", vocab= "pbdb", base_name="Canis",
show="coords")
X11(width=13, height=7.8)
pbdb_map_occur (data,res=2)
## to obtain the raster file without plotting it
pbdb_map_occur (data,res=3,do.plot=F)

Page

function (data, res = 5, col.int = "white", col.ocean = "black", 
    col.eff = c("light blue", "blue"), do.plot = TRUE, ...) 
{
    if (sum((colnames(data) %in% c("lat", "lng"))) != 2) {
        stop("Invalid data input. Please, add show=c('coord') to your pbdb_occurrences query")
    }
    Y <- .extract.LatLong(data)
    r <- .Raster(Y, res, col.int, col.ocean, ...)
    if (do.plot == T) {
        .plot.Raster.rich(r, col.eff, col.ocean, col.int, res, 
            ...)
        mtext("Number of records", 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、付费专栏及课程。

余额充值