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
相关推荐
крон8 分钟前
【Auto.js例程】华为备忘录导出到其他手机
开发语言·javascript·智能手机
zh_xuan42 分钟前
c++ 单例模式
开发语言·c++·单例模式
老胖闲聊1 小时前
Python Copilot【代码辅助工具】 简介
开发语言·python·copilot
Blossom.1181 小时前
使用Python和Scikit-Learn实现机器学习模型调优
开发语言·人工智能·python·深度学习·目标检测·机器学习·scikit-learn
曹勖之2 小时前
基于ROS2,撰写python脚本,根据给定的舵-桨动力学模型实现动力学更新
开发语言·python·机器人·ros2
豆沙沙包?2 小时前
2025年- H77-Lc185--45.跳跃游戏II(贪心)--Java版
java·开发语言·游戏
军训猫猫头2 小时前
96.如何使用C#实现串口发送? C#例子
开发语言·c#
liuyang-neu3 小时前
java内存模型JMM
java·开发语言
我很好我还能学4 小时前
【面试篇 9】c++生成可执行文件的四个步骤、悬挂指针、define和const区别、c++定义和声明、将引用作为返回值的好处、类的四个缺省函数
开发语言·c++
蓝婷儿5 小时前
6个月Python学习计划 Day 16 - 面向对象编程(OOP)基础
开发语言·python·学习