search for: s4classholdingextptr

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

2018 Mar 18
3
`@<-` modify its argument when slot is externalptr
...library(inline) # Function to generate an externalptr object with random address new_extptr <- cfunction(c(), ' SEXP val = PROTECT(ScalarLogical(1)); SEXP out = PROTECT(R_MakeExternalPtr(&val, R_NilValue, val)); UNPROTECT(2); return(out); ') setClass("S4ClassHoldingExtptr", contains = "externalptr") subs_extptr_1 <- function(x) { x at .xData <- new_extptr() x } subs_extptr_2 <- function(x) { x <- `@<-`(x, ".xData", new_extptr()) x } I expect functions "subs_extptr_1" and "subs_extptr_2...
2018 Mar 18
0
`@<-` modify its argument when slot is externalptr
...to generate an externalptr object with random address > new_extptr <- cfunction(c(), ' > SEXP val = PROTECT(ScalarLogical(1)); > SEXP out = PROTECT(R_MakeExternalPtr(&val, R_NilValue, val)); > UNPROTECT(2); > return(out); > ') > > setClass("S4ClassHoldingExtptr", contains = "externalptr") > > subs_extptr_1 <- function(x) { > x at .xData <- new_extptr() > x > } > > subs_extptr_2 <- function(x) { > x <- `@<-`(x, ".xData", new_extptr()) > x > } > > I expect functions...