[Rd] Lack of 'seq_len' in 'head' in 'stopifnot'
maechler at stat.math.ethz.ch
Sat Feb 4 17:27:54 CET 2017
>>>>> Suharto Anggono Suharto Anggono via R-devel <r-devel at r-project.org>
>>>>> on Sat, 4 Feb 2017 10:18:33 +0000 writes:
> Function 'stopifnot' in R devel r72104 has this.
> head <- function(x, n = 6L) ## basically utils:::head.default()
> x[if(n < 0L) max(length(x) + n, 0L) else min(n, length(x))]
> If definition like utils:::head.default is intended, the index of 'x' should be wrapped in seq_len(...):
You are right... that was "lost in translation" .
As seq_len(1) is 1 and that seems to have been the only case
much exercised, nobody seems to have noticed the problem till
now ((this assumes people *would* report it if they noticed.
Yes, "hope dies last" ;-))
Thank you, this is amended now.
More information about the R-devel