Re: [Rd] head.matrix can return 1000s of columns -- limit to n or add new argument?

2019-07-12 Thread Gabriel Becker
Hi Michael and Abby, So one thing that could happen that would be backwards compatible (with the exception of something that was an error no longer being an error) is head and tail could take vectors of length (dim(x)) rather than integers of length for n, with the default being n=6 being equivale

Re: [Rd] head.matrix can return 1000s of columns -- limit to n or add new argument?

2019-07-12 Thread Abby Spurdle
> I assume there are lots of backwards-compatibility issues as well as valid > use cases for this behavior, so I guess defaulting to M[1:6, 1:6] is out of > the question. Agree. > Is there any scope for adding a new argument to head.matrix that would > allow this flexibility? I agree with what y

Re: [Rd] strange increase in the reference number

2019-07-12 Thread Gabriel Becker
Hi Jiefei and Duncan, I suspect what is likely happening is that one of ENSURE_NAMEDMAX or MARK_NOT_MUTABLE are being hit for x. These used to set named to 3, but now set it to 7 (ie the previous and current NAMEDMAX value, respectively). Because these are macros rather than C functions, its no

Re: [Rd] strange increase in the reference number

2019-07-12 Thread Duncan Murdoch
On 12/07/2019 1:22 p.m., King Jiefei wrote: Hi, I just found a strange increase in the reference number and I'm wondering if there is any reason for it, here is the code. a=c(1,2,3) .Internal(inspect(a)) @0x1bf0b9b0 14 REALSXP g0c3 [NAM(1)] (len=3, tl=0) 1,2,3 is.vector(a) [1] TRUE

[Rd] strange increase in the reference number

2019-07-12 Thread King Jiefei
Hi, I just found a strange increase in the reference number and I'm wondering if there is any reason for it, here is the code. > a=c(1,2,3) > .Internal(inspect(a)) @0x1bf0b9b0 14 REALSXP g0c3 [NAM(1)] (len=3, tl=0) 1,2,3 > is.vector(a) [1] TRUE > .Internal(inspect(a)) @0x1bf0b9b0