Skip to content
Back to formatted view

Raw Message

Message-ID: <CAGiFhPPT8UUjB0shOOfWZcNBwFiVWq68T=B23WhMJrVaQyY6Tg@mail.gmail.com>
Date: 2019-07-12T17:22:22Z
From: Jiefei Wang
Subject: strange increase in the reference number

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))
@0x000000001bf0b9b0 14 REALSXP g0c3 [NAM(1)] (len=3, tl=0) 1,2,3
> is.vector(a)
[1] TRUE
> .Internal(inspect(a))
@0x000000001bf0b9b0 14 REALSXP g0c3 [NAM(7)] (len=3, tl=0) 1,2,3

The variable *a* initially has one reference number, after calling
*is.vector* function, the reference number goes to 7, which I believe is
the highest number that is allowed in R.  I also tried the other R
functions, *is.atomic, is.integer* and *is.numeric* do not increase the
reference number, but *typeof *will do. Is it intentional?

Best,
Jiefei

	[[alternative HTML version deleted]]