R语言【taxlist】——subset():取taxlist对象的子集

Package taxlist version 0.2.4


Description

taxlist对象的子集将通过逻辑操作或模式匹配来完成。子集可以引用包含在插槽taxonNames、taxonRelations或taxonTraits中的信息。


Usage

R 复制代码
## S4 method for signature 'taxlist'
subset(
  x,
  subset,
  slot = "names",
  keep_children = FALSE,
  keep_parents = FALSE,
  ...
)

Arguments

参数【x】:taxlist 对象。

参数【subset】:以逻辑向量或逻辑操作来实现子集。

参数【slot】:字符值,指示应用于子集的slot。

参数【keep_children】:逻辑值,是否保留子类群。

参数【keep_parents】:逻辑值,是否保留父类群。

参数【...】:传递给其他方法或从其他方法传递的进一步参数。


Details

参数【subset】将应用于参数slot中指定的slot。这个参数也允许部分匹配。

参数keep_children和keep_parents应用于对象,包括父子关系。当这些参数设置为FALSE(默认值)时,所选分类单元概念的子概念或父概念将不包括在子集中。

请注意,在函数定义内部,subset()不能正常工作。


Example

R 复制代码
sp_list <- subset(x = Easplist, subset = life_form == "reed_plant",
    slot = "taxonTraits", keep_parents = TRUE)

sp_list
复制代码
object size: 22.3 Kb 
validation of 'taxlist' object: TRUE 

number of taxon usage names: 100 
number of taxon concepts: 27 
trait entries: 14 
number of trait variables: 1 
taxon views: 3 

concepts with parents: 24 
concepts with children: 13 

hierarchical levels: form < variety < subspecies < species < complex < genus < family 
number of concepts in level form: 0
number of concepts in level variety: 0
number of concepts in level subspecies: 0
number of concepts in level species: 14
number of concepts in level complex: 0
number of concepts in level genus: 10
number of concepts in level family: 3
R 复制代码
summary(as.factor(sp_list$life_form))
复制代码
reed_plant       NA's 
        14         13 
相关推荐
leaves falling8 小时前
C++模板进阶
开发语言·c++
坐吃山猪9 小时前
Python27_协程游戏理解
开发语言·python·游戏
gCode Teacher 格码致知9 小时前
Javascript提高:小数精度和随机数-由Deepseek产生
开发语言·javascript·ecmascript
椰猫子9 小时前
Javaweb(Filter、Listener、AJAX、JSON)
java·开发语言
盛世宏博北京10 小时前
以太网温湿度传感器运维技巧,提升设备稳定性与使用寿命
开发语言·php·以太网温湿度传感器
代码改善世界10 小时前
【MATLAB初阶】矩阵操作(一)
开发语言·matlab·矩阵
覆东流10 小时前
第1天:Python环境搭建 & 第一个程序
开发语言·后端·python
朝阳58111 小时前
rust 交叉编译指南
开发语言·后端·rust
量子炒饭大师11 小时前
【C++ 进阶】Cyber霓虹掩体下的代码拟态——【面向对象编程 之 多态】一文带你搞懂C++面向对象编程中的三要素之一————多态!
开发语言·c++·多态
xiaoshuaishuai812 小时前
C# 实现百度搜索算法逆向
开发语言·windows·c#·dubbo