R语言【paleobioDB】——pbdb_temp_range():绘制指定类群的时空范围

Package paleobioDB version 0.7.0

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

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


Usage

R 复制代码
pbdb_temp_range (data, rank, col = "#0000FF", 
names = TRUE, do.plot =TRUE)

Arguments

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

参数【rank】:设置感兴趣的分类阶元。

参数【col】:改变图中柱子的颜色。默认为 skyblue2。

参数【names】:TRUE/FALSE。默认为TRUE。图像中是否显示类群名称。

参数【do.plot】:TRUE/FALSE。默认为TRUE。


Value

包含所选分类群(物种、属等)时间跨度的图和数据帧。


Example

R 复制代码
library(paleobioDB)
library(RCurl)

options(RCurlOptions = list(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl")))

canis_quaternary<- pbdb_occurrences (limit="all", base_name="Canis", 
                 interval="Quaternary", show=c("coords", "phylo", "ident"))

pbdb_temp_range (canis_quaternary, rank="species", names=FALSE)

Page

R 复制代码
function (data, rank, col = "#0000FF", names = TRUE, do.plot = TRUE) 
{
    temporal_range <- .extract_temporal_range(data, rank)
    if (do.plot == TRUE) {
        pos <- c(1:dim(temporal_range)[1] - 0.9)
        t_range <- cbind(temporal_range, pos)
        par(mar = c(4, 0, 1, 15))
        plot(c(min(t_range$max), max(t_range$max)), c(0, dim(t_range)[1]), 
            type = "n", axes = FALSE, xlab = "Time (Ma)", ylab = "", 
            xlim = c(max(t_range$max), min(t_range$max)))
        segments(x0 = t_range$min, y0 = t_range$pos, x1 = t_range$max, 
            y1 = t_range$pos, col = col, lwd = 6, lend = 2)
        axis(1, col = "gray30", cex.axis = 0.8)
        if (names == TRUE) {
            text(x = t_range$min - 0.3, y = t_range$pos, labels = row.names(t_range), 
                adj = c(0, 0), cex = 0.5, col = "gray30")
        }
    }
    return(temporal_range)
}
相关推荐
BK贝壳1 小时前
浮点值也能挂进混合数组:bool-hybrid-array 的 FloatHybridArray 构造、下标与追加本机实测
开发语言·数据结构·python·性能优化·numpy
雷✘1 小时前
C++map 和 set 的使用
linux·开发语言·c++
代码民工正电荷9 小时前
JAVA重要知识点和集合
java·开发语言
星恒随风9 小时前
C++11 加餐(4)并发支持库——condition_variable 条件变量与生产者消费者模型
开发语言·c++
利威尔xu10 小时前
Go map 并发十连问:多 goroutine 同时读写触发 fatal error,进程直接崩溃
开发语言·golang
你不知道我是谁?10 小时前
GESP C++ 补充知识:浮点数格式化输出(%f/%e/%g)与 fmod 浮点余数实战
开发语言·c++
九蝶科技10 小时前
运费分摊的二开实现:BigDecimal 精确分摊 + 尾差补齐 + 暂估调整
开发语言·python
Ryan-Zhong11 小时前
一次接入 16 个平台:视频链接元数据解析 API 的 Python 实战与踩坑记录
开发语言·python·dreamweaver
无限聚核12 小时前
PHP 对接美团、抖音团购核销接口:预核销、核销、重试和撤销一份代码跑通,无限聚核
开发语言·php·美团·团购核销接口
向科→向总工→空间动态计系统14 小时前
动态零轴融合三铁律
大数据·开发语言·人工智能·python·机器人