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
相关推荐
MSTcheng.2 分钟前
【C++】C++11新特性(二)
java·开发语言·c++·c++11
晓13135 分钟前
第七章 【C语言篇:文件】 文件全面解析
linux·c语言·开发语言
愚者游世5 分钟前
Delegating Constructor(委托构造函数)各版本异同
开发语言·c++·程序人生·面试·改行学it
梵刹古音7 分钟前
【C语言】 指针基础与定义
c语言·开发语言·算法
Ekehlaft10 分钟前
这款国产 AI,让 Python 小白也能玩转编程
开发语言·人工智能·python·ai·aipy
rit843249913 分钟前
MATLAB中Teager能量算子提取与解调信号的实现
开发语言·matlab
开源技术15 分钟前
Python GeoPandas基础知识:地图、投影和空间连接
开发语言·ide·python
Cult Of19 分钟前
Alicea Wind的个人网站开发日志(2)
开发语言·python·vue
我找到地球的支点啦24 分钟前
通信扩展——扩频技术(超级详细,附带Matlab代码)
开发语言·matlab
微小冷43 分钟前
Rust异步编程详解
开发语言·rust·async·await·异步编程·tokio