[Rd] Lack of 'seq_len' in 'head' in 'stopifnot'

2017-02-04 Thread Suharto Anggono Suharto Anggono via R-devel
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(...): x[seq_l

Re: [Rd] RFC: tapply(*, ..., init.value = NA)

2017-02-04 Thread Martin Maechler
> Suharto Anggono Suharto Anggono via R-devel > on Wed, 1 Feb 2017 16:17:06 + writes: > On 'aggregate data.frame', the URL should be > https://stat.ethz.ch/pipermail/r-help/2016-May/438631.html . thank you. Yes, using 'drop' makes sense there where the result is always "l

Re: [Rd] Lack of 'seq_len' in 'head' in 'stopifnot'

2017-02-04 Thread Martin Maechler
> Suharto Anggono Suharto Anggono via R-devel > on Sat, 4 Feb 2017 10:18:33 + 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