-----Original Message-----
From: r-devel-bounces at r-project.org
[mailto:r-devel-bounces at r-project.org] On Behalf Of Martin Maechler
Sent: Friday, June 04, 2010 2:46 AM
To: Herv? Pag?s
Cc: r-devel at stat.math.ethz.ch
Subject: Re: [Rd] Argument recycling in substring()
"HP" == Herv? Pag?s <hpages at fhcrc.org>
on Thu, 03 Jun 2010 17:53:33 -0700 writes:
HP> Hi,
HP> According to its man page substring() "expands (its) arguments
HP> cyclically to the length of the longest _provided_ none are of
HP> zero length".
HP> So, as expected, I get an error here:
>> substring("abcd", first=2L, last=integer(0))
HP> Error in substring("abcd", first = 2L, last = integer(0)) :
HP> invalid substring argument(s)
HP> But I don't get one here:
>> substring(character(0), first=1:2, last=3L)
HP> character(0)
HP> which is unexpected. according to the docu.
My gut feeling would say that the documentation should be
updated in this case, rather than the implementation.
RFC! other opinions?