[英]Read Authors@R field from DESCRIPTION of R package as vector
How can I read Authors@R
field from DESCRIPTION
file as vector?如何从
DESCRIPTION
文件中读取Authors@R
字段作为矢量?
> packageDescription("dplyr")$`Authors@R`
[1] "\n c(person(given = \"Hadley\",\n family = \"Wickham\",\n role = c(\"aut\", \"cre\"),\n email = \"hadley@rstudio.com\",\n comment = c(ORCID = \"0000-0003-4757-117X\")),\n person(given = \"Romain\",\n family = \"François\",\n role = \"aut\",\n comment = c(ORCID = \"0000-0002-2444-4226\")),\n person(given = \"Lionel\",\n family = \"Henry\",\n role = \"aut\"),\n person(given = \"Kirill\",\n family = \"Müller\",\n role = \"aut\",\n comment = c(ORCID = \"0000-0002-1416-3412\")),\n person(given = \"RStudio\",\n role = c(\"cph\", \"fnd\")))"
We may wrap with eval(parse
as it returns a string我们可以用
eval(parse
因为它返回一个字符串
eval(parse(text = packageDescription("dplyr")$`Authors@R`))
ie if we check with cat
即如果我们检查
cat
cat(packageDescription("dplyr")$`Authors@R`)
c(person(given = "Hadley",
family = "Wickham",
role = c("aut", "cre"),
email = "hadley@rstudio.com",
comment = c(ORCID = "0000-0003-4757-117X")),
person(given = "Romain",
family = "François",
role = "aut",
comment = c(ORCID = "0000-0002-2444-4226")),
person(given = "Lionel",
family = "Henry",
role = "aut"),
person(given = "Kirill",
family = "Müller",
role = "aut",
comment = c(ORCID = "0000-0002-1416-3412")),
person(given = "RStudio",
role = c("cph", "fnd")))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.