[R] Minor documentation issue

Duncan Murdoch murdoch at stats.uwo.ca
Sat Apr 22 03:55:54 CEST 2006


On 4/21/2006 9:26 PM, Vivek Satsangi wrote:
> (Sorry about the last email which was incomplete. I hit 'send' accidentally).
> 
> I looked at ?seq. One of the forms given under "Usage" is seq(from).
> This would be the form used if seq is called with only one argument.
> However, this should actually say seq(to). For example,
>> seq(1)
> [1] 1
>> seq(3)
> [1] 1 2 3

Try this:

 > debug(seq.default)
 > seq(3)

You'll then drop into the browser at the start of executing the 
seq.default function.  You can print the value of "to" and of "from", 
and you'll see this:

Browse[1]> to
[1] 1
Browse[1]> from
[1] 3

So the documentation is correct, even if the usage in this case is the 
reverse of English usage.

(You'll quickly want "undebug(seq.default)" if you don't want to spend a 
lot of time in the debugger; seq() is a pretty commonly used function!)

Duncan Murdoch




More information about the R-help mailing list