From cbeleites at units.it  Tue Aug 17 16:26:36 2010
From: cbeleites at units.it (Claudia Beleites)
Date: Tue, 17 Aug 2010 16:26:36 +0200
Subject: [Rd] prompt () and backticks for default arguments
In-Reply-To: <alpine.LFD.2.00.1008171231140.16450@gannet.stats.ox.ac.uk>
References: <4C6A418D.5080009@units.it>
	<alpine.LFD.2.00.1008171231140.16450@gannet.stats.ox.ac.uk>
Message-ID: <4C6A9C1C.9080700@units.it>

Thanks, that works.

Are there any drawbacks to doing that in general?

If not, I suggest the following patch for utils/prompt.R

87c87,88
<                               paste(deparse(argls[[i]], width.cutoff= 500L),
---
 >                               paste(deparse(argls[[i]], width.cutoff= 500L,
 >                                             backtick = TRUE),

(Did I get right that this is waht I'm supposed to do?)

Best regards & thanks again,

Claudia


Prof Brian Ripley wrote:
> 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
>>
> 


-- 
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



[Rd] prompt () and backticks for default arguments
Claudia Beleites