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
相关推荐
Blossom.1181 小时前
使用Python实现简单的人工智能聊天机器人
开发语言·人工智能·python·低代码·数据挖掘·机器人·云计算
da-peng-song2 小时前
ArcGIS Desktop使用入门(二)常用工具条——数据框工具(旋转视图)
开发语言·javascript·arcgis
galaxy_strive2 小时前
qtc++ qdebug日志生成
开发语言·c++·qt
TNTLWT2 小时前
Qt功能区:简介与安装
开发语言·qt
等等5433 小时前
Java EE初阶——wait 和 notify
java·开发语言
低代码布道师3 小时前
第五部分:第一节 - Node.js 简介与环境:让 JavaScript 走进厨房
开发语言·javascript·node.js
盛夏绽放3 小时前
Python字符串常用方法详解
开发语言·python·c#
好吃的肘子4 小时前
Elasticsearch架构原理
开发语言·算法·elasticsearch·架构·jenkins
nlog3n5 小时前
Go语言交替打印问题及多种实现方法
开发语言·算法·golang
kaixin_learn_qt_ing5 小时前
Golang
开发语言·后端·golang