search for: g0c2

Displaying 14 results from an estimated 14 matches for "g0c2".

Did you mean: g0c0
2013 Jul 24
1
Understanding modification in place
...essage("Global") x <- 1:3 .Internal(inspect(x)) x[2] <- 1L .Internal(inspect(x)) message("In function") (function() { x <- 1:3 .Internal(inspect(x)) x[2] <- 1L .Internal(inspect(x)) })() If I run it from the command line, I get: Global @1050bb840 13 INTSXP g0c2 [MARK,NAM(1)] (len=3, tl=0) 1,2,3 @1050bb840 13 INTSXP g0c2 [MARK,NAM(1)] (len=3, tl=0) 1,1,3 In function @1050bb190 13 INTSXP g0c2 [NAM(1)] (len=3, tl=0) 1,2,3 @1050bb190 13 INTSXP g0c2 [NAM(1)] (len=3, tl=0) 1,1,3 i.e. both modifications occur in place. If I put it in a file and source() it, I...
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)
2019 Jul 17
2
ALTREP wrappers and factors
...<- matter:::as.altrep(y) > > .Internal(inspect(y)) @7fb0ce78c0f0 13 INTSXP g0c0 [NAM(7)] matter vector (mode=3, len=3, mem=0) Here is what I get without a wrapper: > fc1 <- structure(y, class="factor", levels=levels(x)) > .Internal(inspect(fc1)) @7fb0cae66408 13 INTSXP g0c2 [OBJ,NAM(2),ATT] (len=3, tl=0) 1,1,2 ATTRIB: @7fb0ce771868 02 LISTSXP g0c0 [] TAG: @7fb0c80043d0 01 SYMSXP g1c0 [MARK,LCK,gp=0x4000] "class" (has value) @7fb0c9fcbe90 16 STRSXP g0c1 [NAM(7)] (len=1, tl=0) @7fb0c80841a0 09 CHARSXP g1c1 [MARK,gp=0x61] [ASCII] [cached] "...
2019 Jul 19
2
ALTREP wrappers and factors
...b0ce78c0f0 13 INTSXP g0c0 [NAM(7)] matter vector (mode=3, len=3, > mem=0) > > > > Here is what I get without a wrapper: > > > > > fc1 <- structure(y, class="factor", levels=levels(x)) > > > .Internal(inspect(fc1)) > > @7fb0cae66408 13 INTSXP g0c2 [OBJ,NAM(2),ATT] (len=3, tl=0) 1,1,2 > > ATTRIB: > > @7fb0ce771868 02 LISTSXP g0c0 [] > > TAG: @7fb0c80043d0 01 SYMSXP g1c0 [MARK,LCK,gp=0x4000] "class" (has > > value) > > @7fb0c9fcbe90 16 STRSXP g0c1 [NAM(7)] (len=1, tl=0) > > @7fb0c80...
2019 Jul 18
0
ALTREP wrappers and factors
...> .Internal(inspect(y)) > @7fb0ce78c0f0 13 INTSXP g0c0 [NAM(7)] matter vector (mode=3, len=3, mem=0) > > Here is what I get without a wrapper: > > > fc1 <- structure(y, class="factor", levels=levels(x)) > > .Internal(inspect(fc1)) > @7fb0cae66408 13 INTSXP g0c2 [OBJ,NAM(2),ATT] (len=3, tl=0) 1,1,2 > ATTRIB: > @7fb0ce771868 02 LISTSXP g0c0 [] > TAG: @7fb0c80043d0 01 SYMSXP g1c0 [MARK,LCK,gp=0x4000] "class" (has > value) > @7fb0c9fcbe90 16 STRSXP g0c1 [NAM(7)] (len=1, tl=0) > @7fb0c80841a0 09 CHARSXP g1c1 [MARK,gp...
2017 Oct 28
0
Cannot Compute Box's M (Three Days Trying...)
...would explain the error in str(), and would lead to lots of other weird problems. Another way to look at R objects from within R is to use .Internal(inspect( x )). For example, > .Internal(inspect(names(iris))) @7f898ff9e2e8 16 STRSXP g0c4 [NAM(2)] (len=5, tl=0) @7f8992c41878 09 CHARSXP g0c2 [gp=0x61,ATT] [ASCII] [cached] "Sepal.Length" @7f8992c41840 09 CHARSXP g0c2 [gp=0x61] [ASCII] [cached] "Sepal.Width" @7f8992c41808 09 CHARSXP g0c2 [gp=0x61,ATT] [ASCII] [cached] "Petal.Length" @7f898ba99f78 09 CHARSXP g0c2 [gp=0x61,ATT] [ASCII] [cached] &qu...
2017 Oct 29
2
Cannot Compute Box's M (Three Days Trying...)
...to lots of other weird problems. >> >> Another way to look at R objects from within R is to use >> .Internal(inspect( x )). For example, >> >> .Internal(inspect(names(iris))) >> @7f898ff9e2e8 16 STRSXP g0c4 [NAM(2)] (len=5, tl=0) >> @7f8992c41878 09 CHARSXP g0c2 [gp=0x61,ATT] [ASCII] [cached] >> "Sepal.Length" >> @7f8992c41840 09 CHARSXP g0c2 [gp=0x61] [ASCII] [cached] "Sepal.Width" >> @7f8992c41808 09 CHARSXP g0c2 [gp=0x61,ATT] [ASCII] [cached] >> "Petal.Length" >> @7f898ba99f78 09 CHARSXP g0c2 [...
2011 Nov 24
1
Confused about NAMED
...@24fc334 16 STRSXP g0c0 [] (len=0, tl=0) TAG: @3f2040 01 SYMSXP g0c0 [MARK,gp=0x4000] "row.names" @24fc318 13 INTSXP g0c0 [] (len=0, tl=0) TAG: @3f2388 01 SYMSXP g0c0 [MARK,gp=0x4000] "class" @25be500 16 STRSXP g0c1 [] (len=1, tl=0) @1d38af0 09 CHARSXP g0c2 [MARK,gp=0x21,ATT] "data.frame" It's a little difficult to search for the word "named" but I tried and found this in R-ints : "Note that optimizing NAMED = 1 is only effective within a primitive (as the closure wrapper of a .Internal will set NAMED = 2 when the pr...
2017 Oct 29
0
Cannot Compute Box's M (Three Days Trying...)
...problems. >> >> Another way to look at R objects from within R is to use >> .Internal(inspect( x )). For example, >> >> .Internal(inspect(names(iris))) >> @7f898ff9e2e8 16 STRSXP g0c4 [NAM(2)] (len=5, tl=0) >> @7f8992c41878 09 CHARSXP g0c2 [gp=0x61,ATT] [ASCII] [cached] >> "Sepal.Length" >> @7f8992c41840 09 CHARSXP g0c2 [gp=0x61] [ASCII] [cached] "Sepal.Width" >> @7f8992c41808 09 CHARSXP g0c2 [gp=0x61,ATT] [ASCII] [cached] >> "Petal.Length" >> @7f898ba99f...
2017 Oct 28
2
Cannot Compute Box's M (Three Days Trying...)
Hey Duncan, Hard to debug? That's an understatement. Eyes bleeding.... In any case, I tried all your suggestions. To get "integer" for the final column, I had to change the code to get integers instead of strings. double[] d1 = ((REXPVector) ((RList) tableRead).get(0)).asDoubles(); double[] d2 = ((REXPVector) ((RList) tableRead).get(1)).asDoubles(); double[] d3 = ((REXPVector)
2020 Jan 09
6
Get memory address of an R data frame
Hello, I would like for my C function to be able to manipulate some values stored in an R data frame. To achieve this, a need the (real) memory address where the R data frame stores its data (hopefully in a contiguous way). Then, from R, I call the C function and passing this memory address as a parameter. The question: how can we get the memory address of the R data frame? Thank you! L.
2020 Jan 09
0
Get memory address of an R data frame
...3e0fb0 16 STRSXP g0c1 [MARK,NAM(7)] (len=1, tl=0) @55aa72be1c70 09 CHARSXP g0c1 [MARK,gp=0x61] [ASCII] [cached] "z" TAG: @55aa72ac9d70 01 SYMSXP g0c0 [MARK,NAM(7),LCK,gp=0x4000] "class" (has value) @55aa73ca59b8 16 STRSXP g0c1 [MARK,NAM(7)] (len=1, tl=0) @55aa72b562b8 09 CHARSXP g0c2 [MARK,gp=0x61,ATT] [ASCII] [cached] "data.frame" TAG: @55aa72ac9670 01 SYMSXP g0c0 [MARK,NAM(7),LCK,gp=0x4000] "row.names" (has value) @55aa743e1c98 13 INTSXP g0c1 [MARK,NAM(7)] (len=2, tl=0) -2147483648,-10 On Thu, Jan 9, 2020 at 6:48 AM lille stor <lille.stor at gmx.com&...
2010 Nov 12
1
SEXPs and slots
Hello, I've created this class: setClass("example", representation ( size = "numeric", id = "character" ) ) Suppose I create a new instance of this class: > x <- new("example", 4, "id_value") This creates an S4 object with two slots. Am I correct in thinking that slots are "filled" by SEXPs?
2010 Nov 15
1
SEXP and slots
...TAG: @769258 01 SYMSXP g1c0 [MARK] "size" >> @c0f6db8 14 REALSXP g0c1 [NAM(2)] (len=1, tl=0) 4 >> TAG: @15b0228 01 SYMSXP g1c0 [MARK,NAM(2)] "id" >> @c0f6178 16 STRSXP g0c1 [NAM(2)] (len=1, tl=0) >> @12341c80 09 CHARSXP g0c2 [gp=0x20] "id_value" >> TAG: @607ce8 01 SYMSXP g1c0 [MARK,NAM(2),gp=0x4000] "class" >> @c0f6d58 16 STRSXP g0c1 [NAM(2),ATT] (len=1, tl=0) >> @96ed08 09 CHARSXP g1c1 [MARK,gp=0x21] "example" >> ATTRIB: >>...