Suharto Anggono Suharto Anggono
2017-Feb-26 12:02 UTC
[Rd] rep/rep.int: in NEWS, but not yet ported from trunk
According to "CHANGES IN R 3.3.2 patched" in NEWS, rep(x, times) and rep.int(x, times) also work when 'times' has length greater than one and has element larger than the maximal integer. In fact, it is still not the case in R 3.3.3 beta r72259. In seq.c (https://svn.r-project.org/R/branches/R-3-3-branch/src/main/seq.c), 'times' that is a vector with storage mode "double" and length greater than one is still changed first to storage mode "integer". Number in 'times' that represents an integer that is larger than the maximal integer becomes NA and error is issued for such 'times'. I have put a comment, https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16932#c30 .
Martin Maechler
2017-Feb-27 09:20 UTC
[Rd] rep/rep.int: in NEWS, but not yet ported from trunk
>>>>> Suharto Anggono Suharto Anggono via R-devel <r-devel at r-project.org> >>>>> on Sun, 26 Feb 2017 12:02:44 +0000 writes:> According to "CHANGES IN R 3.3.2 patched" in NEWS, rep(x, > times) and rep.int(x, times) also work when 'times' has > length greater than one and has element larger than the > maximal integer. In fact, it is still not the case in R > 3.3.3 beta r72259. In seq.c > (https://svn.r-project.org/R/branches/R-3-3-branch/src/main/seq.c), > 'times' that is a vector with storage mode "double" and > length greater than one is still changed first to storage > mode "integer". Number in 'times' that represents an > integer that is larger than the maximal integer becomes NA > and error is issued for such 'times'. > I have put a comment, > https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16932#c30 > . Thank you for noticing! - I've changed the NEWS entry for R-patched (and moved the more general statement to a new entry for R-devel). - The changes were quite substantial so I did not port them to R-patched at the time.. We could have ported them later, but not now, immediately before code freeze (of R 3.3.3). - I would say rep(5, list(6)) was never "meant to" work and had worked incidentally only. OTOH, you are correct with your comments 11 & 29 in the about bug report, and your proposal to make the simple case rep(s, list(7)) work as previously seems ok to me. However, for all this, we will concentrate on R-devel (to become R 3.4.0). Best regards, Martin Maechler