search for: g0c7

Displaying 10 results from an estimated 10 matches for "g0c7".

Did you mean: 80c7
2020 Jul 22
3
Invisible names problem
I ran into strange behavior when removing names. Two ways of removing names: i <- rep(1:4, length.out=20000) k <- c(a=1, b=2, c=3, d=4) x1 <- unname(k[i]) x2 <- k[i] x2 <- unname(x2) Are they identical? identical(x1,x2) # TRUE but no identical(serialize(x1,NULL),serialize(x2,NULL)) # FALSE But problem is with serialization type 3, cause:
2020 Jul 22
0
Invisible names problem
Very interesting: > .Internal(inspect(k[i])) @10a4bc000 14 REALSXP g0c7 [ATT] (len=20000, tl=0) 1,2,3,4,1,... ATTRIB: @7fa24f07fa58 02 LISTSXP g0c0 [REF(1)] TAG: @7fa24b803e90 01 SYMSXP g0c0 [MARK,REF(5814),LCK,gp=0x6000] "names" (has value) @10a4e4000 16 STRSXP g0c7 [REF(1)] (len=20000, tl=0) @7fa24ba575c8 09 CHARSXP g0c1 [MARK,REF(35005),gp...
2018 Dec 30
0
Bug report with patch: `stats:::regularize.values()` always creates full copies of `x` and `y`
...: x <- seq(1, 100, 1) y <- seq(1, 100, 1) reg_xy <- stats:::regularize.values(x, y, mean) # Regularized versions of `x` and `y` are identical to input but are stored at # different places identical(x, reg_xy[["x"]]) #> [1] TRUE .Internal(inspect(x)) #> @15719b0 14 REALSXP g0c7 [NAM(3)] (len=100, tl=0) 1,2,3,4,5,... .Internal(inspect(reg_xy[["x"]])) #> @2b84130 14 REALSXP g0c7 [NAM(3)] (len=100, tl=0) 1,2,3,4,5,... identical(y, reg_xy[["y"]]) #> [1] TRUE .Internal(inspect(y)) #> @2c91be0 14 REALSXP g0c7 [NAM(3)] (len=100, tl=0) 1,2,3,4,5,......
2019 Jan 04
0
Bug report with patch: `stats:::regularize.values()` always creates full copies of `x` and `y`
...: x <- seq(1, 100, 1) y <- seq(1, 100, 1) reg_xy <- stats:::regularize.values(x, y, mean) # Regularized versions of `x` and `y` are identical to input but are stored at # different places identical(x, reg_xy[["x"]]) #> [1] TRUE .Internal(inspect(x)) #> @15719b0 14 REALSXP g0c7 [NAM(3)] (len=100, tl=0) 1,2,3,4,5,... .Internal(inspect(reg_xy[["x"]])) #> @2b84130 14 REALSXP g0c7 [NAM(3)] (len=100, tl=0) 1,2,3,4,5,... identical(y, reg_xy[["y"]]) #> [1] TRUE .Internal(inspect(y)) #> @2c91be0 14 REALSXP g0c7 [NAM(3)] (len=100, tl=0) 1,2,3,4,5,......
2016 Aug 05
2
Extra copies of objects in environments when using $ operator?
My understanding is that R will not make copies of lists if there is only one reference to the object. However, I've encountered a case where R does make copies, even though (I think) there should be only one reference to the object. I hope that someone could shed some light on why this is happening. I'll start with a simple example. Below, x is a list with one element, and changing that
2020 Oct 07
2
Coercion function does not work for the ALTREP object
...However, if I create a vector of length 1024, R will give me a normal real-type vector ``` > x <- 1:1024 > y <- wrap_altrep(x) > .Internal(inspect(y)) @0x000000001f8ddb20 13 INTSXP g0c0 [REF(2)] I am altrep > y[1] <- 1.0 > .Internal(inspect(y)) @0x000000001f0d72a0 14 REALSXP g0c7 [REF(1)] (len=1024, tl=0) 1,2,3,4,5,... ``` Note that the duplicate function is also called for the first example. It seems like R completely ignores my ALTREP functions in the second example. I feel this might be designed on purpose, but I do not understand the reason behind it. Is there any reas...
2016 Aug 05
0
Extra copies of objects in environments when using $ operator?
...references by setting NAMED to 2. You can see this with > e <- new.env(parent = emptyenv()) > e$x <- list(1) > .Internal(inspect(e)) @30b2498 04 ENVSXP g0c0 [NAM(1)] <0x30b2498> ENCLOS: @2600e98 04 ENVSXP g0c0 [MARK,NAM(2)] <R_EmptyEnv> HASHTAB: @2e41540 19 VECSXP g0c7 [] (len=29, tl=1) @25c9628 00 NILSXP g0c0 [MARK,NAM(2)] @25c9628 00 NILSXP g0c0 [MARK,NAM(2)] @25c9628 00 NILSXP g0c0 [MARK,NAM(2)] @25c9628 00 NILSXP g0c0 [MARK,NAM(2)] @30b3370 02 LISTSXP g0c0 [] TAG: @2637870 01 SYMSXP g0c0 [MARK,NAM(2)] "x" @3569...
2020 Oct 08
1
Coercion function does not work for the ALTREP object
...al-type vector >> ``` >> > x <- 1:1024 >> > y <- wrap_altrep(x) >> > .Internal(inspect(y)) >> @0x000000001f8ddb20 13 INTSXP g0c0 [REF(2)] I am altrep >> > y[1] <- 1.0 >> > .Internal(inspect(y)) >> @0x000000001f0d72a0 14 REALSXP g0c7 [REF(1)] (len=1024, tl=0) >> 1,2,3,4,5,... >> ``` >> >> Note that the duplicate function is also called for the first example. It >> seems like R completely ignores my ALTREP functions in the second example. >> I feel this might be designed on purpose, but I do n...
2020 Oct 07
0
Coercion function does not work for the ALTREP object
...R will give me a normal > real-type vector > ``` > > x <- 1:1024 > > y <- wrap_altrep(x) > > .Internal(inspect(y)) > @0x000000001f8ddb20 13 INTSXP g0c0 [REF(2)] I am altrep > > y[1] <- 1.0 > > .Internal(inspect(y)) > @0x000000001f0d72a0 14 REALSXP g0c7 [REF(1)] (len=1024, tl=0) 1,2,3,4,5,... > ``` > > Note that the duplicate function is also called for the first example. It > seems like R completely ignores my ALTREP functions in the second example. > I feel this might be designed on purpose, but I do not understand the > reason...
2013 Mar 22
1
Why does typeof() modify an object's "named" field?
Hello, Doing typeof() on an object appears to reset the "named" field in its sxpinfo header to 2, which can change the way that subsequent subassignment operations are carried out: X <- 1:5e7 .Internal(inspect(X)) # @4eeb0008 13 INTSXP g0c7 [NAM(1)] (len=50000000, tl=0) 1,2,3,4,5,... system.time(X[1] <- 9L) # user system elapsed # 0 0 0 typeof(X) .Internal(inspect(X)) # @4eeb0008 13 INTSXP g1c7 [MARK,NAM(2)] (len=50000000, tl=0) 9,2,3,4,5,... system.time(X[2] <- 9L) # user system elapsed # 0.16...