From ripley at stats.ox.ac.uk  Tue Aug 17 13:36:09 2010
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue, 17 Aug 2010 12:36:09 +0100 (BST)
Subject: [Rd] prompt () and backticks for default arguments
In-Reply-To: <4C6A418D.5080009@units.it>
References: <4C6A418D.5080009@units.it>
Message-ID: <alpine.LFD.2.00.1008171231140.16450@gannet.stats.ox.ac.uk>

On Tue, 17 Aug 2010, Claudia Beleites wrote:

> Dear all,
>
> I just noticed, that prompt () looses backticks that protect default 
> arguments:
>
> f <- function (FUN = `*`) {}
>
> cat (prompt (f, NA)$usage)
>
> yields:
> \usage{ f(FUN = *) } %- maybe also 'usage' for other objects documented here.
> without the backticks, which is of course found by R CMD check as syntax 
> error.
>
> While this is easily fixed if the .Rd is further edited manually, I stumbled 
> over it using the automated .Rd generation with inlinedocs - in this 
> combination it is very inconvenient.
>
> Any suggestions?

Add backtick = TRUE to the deparse() call in prompt.default().

>
> All the best,
>
> Claudia
>
>
> -- 
> Claudia Beleites
> Dipartimento dei Materiali e delle Risorse Naturali
> Universit? degli Studi di Trieste
> Via Alfonso Valerio 6/a
> I-34127 Trieste
>
> phone: +39 0 40 5 58-37 68
> email: cbeleites at units.it
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] prompt () and backticks for default arguments
Prof Brian Ripley