R语言【paleobioDB】——pbdb_temporal_resolution():展示化石数据的时空分辨率

Package paleobioDB version 0.7.0

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

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


Usage

R 复制代码
pbdb_temporal_resolution (data, do.plot=TRUE)

Arguments

参数【data】:输入的数据,数据帧格式。可以通过 **pbdb_occurrences()**函数获得数据。

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


Value

一个图和一个列表,其中包含数据的时间分辨率(最小值、最大值、第 1 和第 3 个四分位数、中位数和平均值)以及每个化石记录的时间分辨率 (马) 的摘要。


Example

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

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


data<- pbdb_occurrences (taxon_name= "Canidae", interval= "Quaternary")

pbdb_temporal_resolution (data)





$summary
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.0117  0.3846  1.5000  2.2046  2.8440 23.0183 

$temporal_resolution
 [1]  3.1000  4.6000  3.1000  3.1000  3.1000  3.1000  3.1000  3.1000
 [9]  4.6000  3.1000  1.5000  1.5000  1.5000  1.5000  1.5000  1.5000
[17]  1.5000  1.0250  0.7693  1.8070  2.5763  2.5763  2.5763  2.5763
[25]  2.5763  5.3213  2.5763  0.7693 23.0183  0.6550  2.5763  0.6550
[33]  0.6550  8.5000  0.6550  3.1000  0.1143  0.1143  2.5880  0.1143
[41]  0.1143  1.8070  0.1143  0.1143  0.1143  2.5880  0.1143  2.5763
[49]  0.1143  1.8070  0.0117  0.6550  0.1143  4.6000  0.0117  0.0117
[57]  0.1143  2.5763  0.1143

Page

R 复制代码
function (data, do.plot = TRUE) 
{
    if ("eag" %in% colnames(data)) {
        diff <- .numeric_age(data$eag) - .numeric_age(data$lag)
        tr <- list(summary = summary(diff), temporal_resolution = diff)
    }
    if ("early_age" %in% colnames(data)) {
        diff <- .numeric_age(data$early_age) - .numeric_age(data$late_age)
        tr <- list(summary = summary(diff), temporal_resolution = diff)
    }
    if (do.plot == TRUE) {
        hist(unlist(tr[[2]]), freq = T, col = "#0000FF", border = F, 
            xlim = c(max(unlist(tr[[2]]), na.rm = TRUE), 0), 
            breaks = 50, xlab = "Temporal resolution of the data (Ma)", 
            main = "", col.lab = "grey30", col.axis = "grey30", 
            cex.axis = 0.8)
    }
    return(tr)
}
相关推荐
2301_765703143 分钟前
C++中的职责链模式实战
开发语言·c++·算法
f狐0狸x17 分钟前
【C++修炼之路】C++ list容器基本用法详解
开发语言·c++·list
坚持就完事了22 分钟前
Java的OOP
java·开发语言
jllllyuz26 分钟前
基于MATLAB的锂电池物理对象建模实现
开发语言·matlab
MyBFuture30 分钟前
C#数组详解:一维二维与交错数组
开发语言·windows·c#·visual studio·vision pro
程序 代码狂人1 小时前
CentOS7初始化配置操作
linux·运维·开发语言·php
从此不归路1 小时前
Qt5 进阶【13】桌面 Qt 项目架构设计:从 MVC/MVVM 到模块划分
开发语言·c++·qt·架构·mvc
zhangx1234_1 小时前
C语言 数据在内存中的存储
c语言·开发语言
星空露珠1 小时前
速算24点检测生成核心lua
开发语言·数据库·算法·游戏·lua
老蒋每日coding1 小时前
Python3基础练习题详解,从入门到熟练的 50 个实例(一)
开发语言·python