search for: coercefunc

Displaying 2 results from an estimated 2 matches for "coercefunc".

2020 Nov 21
3
Two ALTREP questions
..., or adding attributes, is a common need for the object operation, I wonder if this missing feature is intended? This also brings my second question, it seems like the ALTREP coercion function does not handle attributes correctly. After the coercion, the ALTREP object will lose its attributes. ``` coerceFunc <- inline::cxxfunction( signature(x = "SEXP", attr = "SEXP" ) , ' SET_ATTRIB(x,attr); return(Rf_coerceVector(x, REALSXP)); ') > coerceFunc(1:6, pairlist(dim = c(2L, 3L))) [1] 1 2 3 4 5 6 > coerceFunc(1:6 + 0L, pairlist(dim = c(2L, 3L))) [,1] [,2] [,3] [1,]...
2020 Nov 21
0
[External] Two ALTREP questions
...with larger vectors; try variants of your examples for more than 64 elements. > This also brings > my second question, it seems like the ALTREP coercion function does not > handle attributes correctly. After the coercion, the ALTREP object will > lose its attributes. > ``` > coerceFunc <- inline::cxxfunction( signature(x = "SEXP", attr = "SEXP" ) , ' > SET_ATTRIB(x,attr); > return(Rf_coerceVector(x, REALSXP)); > ') >> coerceFunc(1:6, pairlist(dim = c(2L, 3L))) > [1] 1 2 3 4 5 6 >> coerceFunc(1:6 + 0L, pairlist(dim = c(2L, 3L)...