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)
}
相关推荐
烂蜻蜓37 分钟前
前端已死?什么是前端
开发语言·前端·javascript·vue.js·uni-app
老猿讲编程40 分钟前
安全C语言编码规范概述
c语言·开发语言·安全
Biomamba生信基地4 小时前
两天入门R语言,周末开讲
开发语言·r语言·生信
RAN_PAND4 小时前
STL介绍1:vector、pair、string、queue、map
开发语言·c++·算法
qwy7152292581634 小时前
13-R数据重塑
服务器·数据库·r语言
Bio Coder4 小时前
R语言安装生物信息数据库包
开发语言·数据库·r语言
Tiger Z4 小时前
R 语言科研绘图第 27 期 --- 密度图-分组
开发语言·程序人生·r语言·贴图
life_time_7 小时前
C语言(22)
c语言·开发语言
Minner-Scrapy7 小时前
DApp 开发入门指南
开发语言·python·web app