当前位置:   article > 正文

R语言【taxlist】——print_name():为发表文章准备可用的格式化名称

R语言【taxlist】——print_name():为发表文章准备可用的格式化名称

Package taxlist version 0.2.4


Description

在撰写关于生物多样性的文章时,可以使用名称自动插入到文件中,包括学名不同元素的典型斜体格式。函数print_name既可以应用于 Markdown 文档,也可以应用于图形。在 Rmarkdown 文档中,使用 *Cyperus papyrus* L. 插入格式化的物种名称。


Usage

  1. print_name(object, ...)
  2. ## S3 method for class 'character'
  3. print_name(
  4. object,
  5. second_mention = FALSE,
  6. style = "markdown",
  7. isolate = c("var.", "ssp.", "subsp.", "f.", "fma."),
  8. trim = c("spp.", "sp.", "species"),
  9. ...
  10. )
  11. ## S3 method for class 'taxlist'
  12. print_name(
  13. object,
  14. id,
  15. concept = TRUE,
  16. include_author = TRUE,
  17. secundum,
  18. style = "markdown",
  19. ...
  20. )

Arguments

参数【object】:一个 taxlist 对象。

参数【...】:方法之间传递了进一步的参数。

参数【second_mention】:逻辑值,属名是否应该缩写。

参数【style】:指示斜体的替代格式的字符值。可用的选项包括“markdown”(在 Rmarkdown 文档中调用)、“html”(用于渲染成 html 文件的文档)、“expression”(用于图形中的标签)和 “knitr”(LaTeX 代码中的格式)。

参数【isolate】:一个字符向量,其中单词(通常是缩写)出现在学名的中间,不采用斜体格式。

参数【trim】:一个字符向量,其单词出现在科学名称的末尾,这些单词也没有斜体格式。

参数【id】:包含概念或名称 ID 的整数。

参数【concept】:逻辑值,id 是否对应于概念 ID 或分类单元使用名称 ID。

参数【include_author】:逻辑值,是否应提及名称的作者。

参数【secundum】:指示槽 taxonViews 中将作为 secundum 提及的列的字符值。


Value

一个字符值,包括斜体字体的格式。


Examples

summary(Easplist, 363, secundum = "secundum")
------------------------------ 
concept ID: 363 
view ID: 1 - African Plant Database (2012) 
level: subspecies 
parent: 362 Ludwigia adscendens (L.) H. Hara 

# accepted name: 
363 Ludwigia adscendens ssp. diffusa (Forssk.) P.H. Raven 

# synonyms (3): 
50037 Ludwigia stolonifera (Guill. & Perr.) P.H. Raven 
52001 Jussiaea stolonifera Guill. & Perr. 
53744 Jussiaea repens auct. 
------------------------------
  1. plot(x = NA, xlim = c(0, 5), ylim = c(7, 1), bty = "n", xaxt = "n", xlab = "",
  2. ylab = "options")
  3. ## Accepted name with author
  4. text(x = 0, y = 1, labels = print_name(Easplist, 363, style = "expression"),
  5. pos = 4)

  1. text(x = 0, y = 2, labels = print_name(Easplist, 363, style = "expression",
  2. secundum = "secundum"), pos = 4, cex = 0.7)

  1. text(x = 0, y = 3, labels = print_name(Easplist, 363, style = "expression",
  2. second_mention = TRUE), pos = 4)

  1. text(x = 0, y = 4, labels = print_name(Easplist, 50037, style = "expression",
  2. concept = FALSE), pos = 4)

text(0, 5, labels = print_name(Easplist, 363, style = "markdown"), pos = 4)

  1. text(0, 6, labels = print_name(Easplist, 363, style = "html"), pos = 4,
  2. cex = 0.7)

  1. text(x = 0, y = 7, labels = print_name(Easplist, 363, style = "knitr"), pos = 4,
  2. cex = 0.7)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/53139
推荐阅读
相关标签
  

闽ICP备14008679号