小编Jon*_*ane的帖子

如何使用[]或[[]]约定引用bibentry类中的特定标记?

我正试图从bib文件中获取特定标签的值.每当我尝试和我们entry["bibtype"]entry[["bibtype"]]我得到一个错误,但entry$bibtype工作正常.

entry<-bibentry(
  bibtype = "Manual",
  title = "R: A Language and Environment for Statistical Computing",
  author = person("R Development Core Team"),
  organization = "R Foundation for Statistical Computing",
  address = "Vienna, Austria",
  year = 2010,
  isbn = "3-900051-07-0",
  url = "http://www.R-project.org/")

# the first two fail
entry["bibtype"]
entry[["bibtype"]]
entry$bibtype

foo <- list("bar" = "baz")

#all of these work
foo["bar"]
foo[["bar"]]
foo$bar
Run Code Online (Sandbox Code Playgroud)

我得到的错误是:

Error in switch(attr(paper, "bibtype"), Article = formatArticle(paper),  : 
  EXPR must be a …
Run Code Online (Sandbox Code Playgroud)

r

4
推荐指数
1
解决办法
713
查看次数

标签 统计

r ×1