R语言【taxa】——as_taxon():转换为 taxon 对象

Package taxa version 0.4.2


Description

将其他对象转换为 taxon 向量。taxon 构造器可能将 基础向量转换为 taxon 向量。


Usage

R 复制代码
as_taxon(x, ...)

Arguments

参数【x】:要转换为 taxon 向量的对象。

参数【...】:其余参数。


Examples

R 复制代码
x <- taxonomy(taxon(name = c('Carnivora', 'Felidae', 'Panthera', 'Panthera leo',
                             'Panthera tigris', 'Ursidae', 'Ursus', 'Ursus arctos'),
                    rank = c('order', 'family', 'genus', 'species',
                             'species', 'family', 'genus', 'species'),
                    id = taxon_id(c('33554', '9681', '9688', '9689',
                                    '9694', '9632', '9639', '9644'),
                                  db = 'ncbi'),
                    auth = c('Bowdich, 1821', 'Fischer de Waldheim, 1817', 'Oken, 1816', 'L., 1758',
                             'L., 1758', 'Fischer de Waldheim, 1817', 'L., 1758', 'L., 1758')),
              supertaxa = c(NA, 1, 2, 3, 3, 1, 6, 7))
names(x) <- letters[1:8]
as_taxon(x)
R 复制代码
<taxon[8]>
                                           a 
          33554|Carnivora Bowdich 1821|order 
                                           b 
9681|Felidae Fischer de Waldheim 1817|family 
                                           c 
               9688|Panthera Oken 1816|genus 
                                           d 
           9689|Panthera leo L. 1758|species 
                                           e 
        9694|Panthera tigris L. 1758|species 
                                           f 
9632|Ursidae Fischer de Waldheim 1817|family 
                                           g 
                    9639|Ursus L. 1758|genus 
                                           h 
           9644|Ursus arctos L. 1758|species 
Rank levels: order < family < genus < species
R 复制代码
> as_taxon(c('Carnivora', 'Felidae', 'Panthera', 'Panthera leo'))
<taxon[4]>
[1] Carnivora    Felidae      Panthera     Panthera leo
> as_taxon(factor(c('Carnivora', 'Felidae', 'Panthera', 'Panthera leo')))
<taxon[4]>
[1] Carnivora    Felidae      Panthera     Panthera leo
相关推荐
TomCode先生2 小时前
c#动态树形表达式详解
开发语言·c#
高-老师2 小时前
基于R语言的物种气候生态位动态量化与分布特征模拟
开发语言·r语言·物种气候
Tiger Z2 小时前
R 语言科研绘图 --- 其他绘图-汇总2
r语言·论文·科研·绘图·研究生
大翻哥哥2 小时前
Python 2025:量化金融与智能交易的新纪元
开发语言·python·金融
weixin_437830943 小时前
使用冰狐智能辅助实现图形列表自动点击:OCR与HID技术详解
开发语言·javascript·ocr
鹿鹿学长4 小时前
2025年全国大学生数学建模竞赛(C题) 建模解析|婴儿染色体数学建模|小鹿学长带队指引全代码文章与思路
c语言·开发语言·数学建模
zhousenshan4 小时前
Python爬虫常用框架
开发语言·爬虫·python
DKPT5 小时前
Java内存区域与内存溢出
java·开发语言·jvm·笔记·学习
WangYan20225 小时前
【物种分布模型】R语言物种气候生态位动态量化与分布特征模拟——气候生态位动态检验、质心转移可视化、适生区预测等
r语言·物种分布模型·物种气候生态位
耶啵奶膘6 小时前
uni-app头像叠加显示
开发语言·javascript·uni-app