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 
相关推荐
万粉变现经纪人43 分钟前
如何解决 pip install -r requirements.txt 私有索引未设为 trusted-host 导致拒绝 问题
开发语言·python·scrapy·flask·beautifulsoup·pandas·pip
qq_479875431 小时前
C++ std::Set<std::pair>
开发语言·c++
云知谷3 小时前
【C++基本功】C++适合做什么,哪些领域适合哪些领域不适合?
c语言·开发语言·c++·人工智能·团队开发
l1t4 小时前
DeepSeek辅助利用搬移底层xml实现快速编辑xlsx文件的python程序
xml·开发语言·python·xlsx
C_Liu_6 小时前
C++:list
开发语言·c++
my rainy days6 小时前
C++:友元
开发语言·c++·算法
小梁努力敲代码6 小时前
java数据结构--List的介绍
java·开发语言·数据结构
云知谷7 小时前
【HTML】网络数据是如何渲染成HTML网页页面显示的
开发语言·网络·计算机网络·html
lly2024067 小时前
SQL ROUND() 函数详解
开发语言