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

Package taxlist version 0.2.4


Description

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


Usage

print_name(object, ...)

## S3 method for class 'character'
print_name(
  object,
  second_mention = FALSE,
  style = "markdown",
  isolate = c("var.", "ssp.", "subsp.", "f.", "fma."),
  trim = c("spp.", "sp.", "species"),
  ...
)

## S3 method for class 'taxlist'
print_name(
  object,
  id,
  concept = TRUE,
  include_author = TRUE,
  secundum,
  style = "markdown",
  ...
)

Arguments

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

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

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

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

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

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

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

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

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

扫描二维码关注公众号,回复: 17374738 查看本文章

参数【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. 
------------------------------
plot(x = NA, xlim = c(0, 5), ylim = c(7, 1), bty = "n", xaxt = "n", xlab = "",
  ylab = "options")

## Accepted name with author
text(x = 0, y = 1, labels = print_name(Easplist, 363, style = "expression"),
  pos = 4)

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

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

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

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

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

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

猜你喜欢

转载自blog.csdn.net/whitedrogen/article/details/135888707