Philip Leifeld
Philip Leifeld

Reputation: 2323

R CITATION file: get rid of comma after last entry?

I am an R package author and have written a CITATION file for inclusion in the package. However, a comma is usually added to the BibTeX output of CITATION entries when I display them using the citation command in R. This is not correct according to the BibTeX specifications. How can I suppress or get rid of this comma -- if possible, already when I write my CITATION file? Why is the comma there in the first place?

I noticed that even the base and the stats package have this comma. Here is an example of the output of citation("base"):

@Manual{,
  title = {R: A Language and Environment for Statistical Computing},
  author = {{R Core Team}},
  organization = {R Foundation for Statistical Computing},
  address = {Vienna, Austria},
  year = {2014},
  url = {http://www.R-project.org/},
}

Note the comma after the url entry and before the last curly brace.

Upvotes: 1

Views: 163

Answers (1)

user20637
user20637

Reputation: 674

You are wrong to say "This is not correct according to the BibTeX specifications". The BibTeX Format Specification at http://www.bibtex.org/Format/ specifically says

The last tag can be finished with a comma, although not necessarily.

@article{mrx05, 
auTHor = "Mr. X", 
Title = {Something Great}, 
publisher = "nob" # "ody", 
YEAR = 2005, 
} 

is a correct BibTeX entry.

Upvotes: 1

Related Questions