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
相关推荐
aramae6 小时前
模拟实现strcmp()(C语言)
c语言·开发语言·后端
泡海椒7 小时前
PDF 表格样式优化:jquick-pdf 边框、圆角、背景色
java·开发语言·pdf
Beyond_System|系统之外8 小时前
【学编程】Python基础编程题100道(21-60)
开发语言·python·算法
景熙55238 小时前
15.Java 8 Stream 流入门到实战
java·开发语言·数据结构
Bruce_Liuxiaowei11 小时前
Python 实例赋值遮蔽类属性:一个从不报错的静默陷阱
开发语言·python·语法糖
aramae12 小时前
MySQL内置函数(7)
开发语言·笔记·后端·mysql·其他
babe小鑫15 小时前
信息与计算科学专业应届生面试 怎么证明自己能解决业务问题
学习·r语言·excel
码行山野赴时序归途15 小时前
链表家族收官篇:循环链表
c语言·开发语言·数据结构·链表
景熙552315 小时前
单体项目编写思路和落地形式
java·开发语言
计算机毕设定制辅导-无忧学长16 小时前
《基于SpringBoot的未成年人健康知识科普平台的设计与实现》
java·开发语言·vue.js·spring boot·未成年人健康知识科普平台