[R] CITATION file with multiple citEntry(): no BibTeX produced by citation()

1 view
Skip to first unread message

Michael Friendly

unread,
Nov 17, 2008, 3:04:47 PM11/17/08
to R-Help
[Using R 2.8.0 / Win XP / ]

I just added a CITATION file to the heplots package--- appended below.
From the document ion for ?CITATION, there can be *one or more* calls to
citEntry() within the CITATION file, and each should produce an object
of class "citation".
With just a single citEntry(), citation produces the expected output,
with BibTeX entry:

> citation("heplots")

To cite package 'heplots' in publications use:

John Fox and Michael Friendly and and Georges Monette (2008).
heplots: Visualizing Tests in Multivariate Linear Models. R package
version 0.8-4. URL http://CRAN.R-project.org/package=heplots

A BibTeX entry for LaTeX users is

@Manual{,
title = {{heplots}: Visualizing Tests in Multivariate Linear Models},
author = {John Fox and Michael Friendly and Georges Monette},
year = {2008},
note = {R package version 0.8-4},
url = {http://CRAN.R-project.org/package=heplots},
}

If I uncomment the second citEntry() in CITATION below and
rebuild/INSTALL, the BibTeX entries
are not produced, though I get both text versions:

> citation("heplots")

To cite package 'heplots' in publications use:

John Fox and Michael Friendly and and Georges Monette (2008).
heplots: Visualizing Tests in Multivariate Linear Models. R package
version 0.8-4. URL http://CRAN.R-project.org/package=heplots

Friendly, M. (2007). HE plots for Multivariate General Linear
Models. Journal of Computational and Graphical Statistics, 2007, 16,
421-444

Did I miss something or is this a bug in citation()?

-Michael


---- begin CITATION ----
citHeader("To cite package 'heplots' in publications use:")

## R >= 2.8.0 passes package metadata to citation().
if(!exists("meta") || is.null(meta)) meta <- packageDescription("heplots")
year <- sub("-.*", "", meta$Date)
note <- sprintf("R package version %s", meta$Version)

citEntry(entry = "Manual",
title = "{heplots}: Visualizing Tests in Multivariate Linear Models",
author = personList(as.person("John Fox"),
as.person("Michael Friendly"),
as.person("Georges Monette")),
year = year,
note = note,
url = "http://CRAN.R-project.org/package=heplots",

textVersion =
paste("John Fox and Michael Friendly and and Georges Monette",
sprintf("(%s).", year),
"heplots: Visualizing Tests in Multivariate Linear Models.",
paste(note, ".", sep = ""),
"URL http://CRAN.R-project.org/package=heplots")
)

#citEntry(entry="Article",
# title = "HE plots for Multivariate General Linear Models",
# author = "Michael Friendly",
# year = "2007",
# journal = "Journal of Computational and Graphical Statistics",
# volume = "16",
# number = "4",
# pages = "421-444",
# textVersion = "Friendly, M. (2007).
# HE plots for Multivariate General Linear Models.
# Journal of Computational and Graphical Statistics, 2007, 16, 421-444"
#)

---- end CITATION ----

--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Street http://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT M3J 1P3 CANADA

______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Achim Zeileis

unread,
Nov 17, 2008, 4:42:14 PM11/17/08
to Michael Friendly, R-Help
On Mon, 17 Nov 2008, Michael Friendly wrote:

> [Using R 2.8.0 / Win XP / ]
>
> I just added a CITATION file to the heplots package--- appended below.
> From the document ion for ?CITATION, there can be *one or more* calls to
> citEntry() within the CITATION file, and each should produce an object
> of class "citation".
>

> If I uncomment the second citEntry() in CITATION below and rebuild/INSTALL,
> the BibTeX entries are not produced,
>

> Did I miss something

Yes, the documentation :-)
?citation says
If only one reference is given, the print method shows both a text
version and a BibTeX entry for it, if a package has more than one
reference then only the text versions are shown. The BibTeX
versions can be obtained using function 'toBibtex' (see the
examples below).

See for example
citation("sandwich")
toBibtex(citation("sandwich"))

To produce the header for the second entry, you can use the header
argument:
citEntry(..., header = "...")

Best,
Z

Michael Friendly

unread,
Nov 18, 2008, 11:15:48 AM11/18/08
to Achim Zeileis, R-Help
Achim Zeileis wrote:
> On Mon, 17 Nov 2008, Michael Friendly wrote:
>>
>> I just added a CITATION file to the heplots package--- appended below.
>> From the document ion for ?CITATION, there can be *one or more* calls to
>> citEntry() within the CITATION file, and each should produce an object
>> of class "citation".
>>
>> If I uncomment the second citEntry() in CITATION below and
>> rebuild/INSTALL, the BibTeX entries are not produced,
>>
>> Did I miss something
>
> Yes, the documentation :-)
> ?citation says
> If only one reference is given, the print method shows both a text
> version and a BibTeX entry for it, if a package has more than one
> reference then only the text versions are shown. The BibTeX
> versions can be obtained using function 'toBibtex' (see the
> examples below).
>
>
OK, my bad --- it's the first time I'm writing a CITATION file.
But it seems that I cannot call
toBibtex(citation("heplots")) from the CITATION file:
WARNING
Invalid citation information in 'inst/CITATION':
all connections are in use
[not a great surprise, because the original citation() ends up calling
citation() again to do the Bibtex]

The best I can do is to use

citFooter("BibTeX entries for LaTeX users: use\n",
sQuote('toBibtex(citation("heplots"))'))

It seems that this restriction is just a function of the default in
utils:::print.citationList:
> args(utils:::print.citationList)
function (x, bibtex = length(x) == 1, ...)

With my current CITATION file I can get what I was expecting with
bibtex=TRUE,
but this is cumbersome for users of citation()

> print(citation("heplots"),bibtex=TRUE)

To cite package 'heplots' in publications use:

John Fox and Michael Friendly and and Georges Monette (2008). heplots:
Visualizing Tests in Multivariate Linear Models. R package version
0.8-4. URL
http://CRAN.R-project.org/package=heplots

A BibTeX entry for LaTeX users is

@Manual{,
title = {{heplots}: Visualizing Tests in Multivariate Linear Models},
author = {John Fox and Michael Friendly and Georges Monette},
year = {2008},
note = {R package version 0.8-4},
url = {http://CRAN.R-project.org/package=heplots},
}

To refer to the theory on which this package is based, also cite:

Friendly, M. (2007). HE plots for Multivariate General Linear Models.
Journal
of Computational and Graphical Statistics, 2007, 16, 421-444

A BibTeX entry for LaTeX users is

@Article{,


title = {HE plots for Multivariate General Linear Models},

author = {Michael Friendly},

year = {2007},


journal = {Journal of Computational and Graphical Statistics},

volume = {16},
number = {4},
pages = {421--444},
}

BibTeX entries for LaTeX users: use ‘toBibtex(citation("heplots"))’

-Michael

--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Street http://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT M3J 1P3 CANADA

______________________________________________

Reply all
Reply to author
Forward
0 new messages