search for: extptrsxp

Displaying 20 results from an estimated 23 matches for "extptrsxp".

2005 Oct 24
2
R_MakeExternalPtr
...objects in a SEXP. The code basically is sexp = R_MakeExternalPtr(handle,R_NilValue,R_NilValue); R_RegisterCFinalizerEx(...); After creating the sexp, LENGTH(sexp) returns some quite large integer value. It seems like an "unitialized" value. Can I safely assume, that an SEXP of type EXTPTRSXP can only contain a single pointer value and never represent a vector (an array) of pointers? Or should I maybe explicitly add something like SETLENGTH(sexp,1); Best wishes from sunny Austria, Thomas Baier
2010 Aug 22
1
Handle RAWSXP in inspect.c:typename()
...uld the following patch be applied (I've just put in inline as it is a trivial 1-liner)? Index: src/main/inspect.c =================================================================== --- src/main/inspect.c (revision 52221) +++ src/main/inspect.c (working copy) @@ -63,6 +63,7 @@ case EXTPTRSXP: return "EXTPTRSXP"; case WEAKREFSXP: return "WEAKREFSXP"; case S4SXP: return "S4SXP"; + case RAWSXP: return "RAWSXP"; default: return "<unknown>"; } Best -- Rory [[alternative HTML version delet...
2005 Jul 19
1
S4 Dispatching
...? Concept was to create a SEXP with R_AllocatePtr, give it a class attribute, and continue dispatch. Example code below omits multiple parameters that can be different types. Essentially, any parameter would be converted to an internal type "class" and the final dispatch would be passing EXTPTRSXP objects. library(methods) setGeneric("onthefly", function(mydata) { cat("generic", match.call()[[1]], "\n") standardGeneric("onthefly") }) setMethod("onthefly", signature(mydata = "character"), fu...
2003 Dec 16
1
Memory issues in "aggregate" (PR#5829)
...CHARSXP LGLSXP INTSXP 207 1177 283663 4661 0 0 49 REALSXP CPLXSXP STRSXP DOTSXP ANYSXP VECSXP EXPRSXP 13383 9 24870 0 0 2598 2 BCODESXP EXTPTRSXP WEAKREFSXP 0 93 0 > memory.size(max = TRUE) [1] 224669696 > memory.size(max = FALSE) [1] 81072656 > attach(pseudo.hist) > pseudo.hist <- pseudo.hist[order(as.numeric(as.character(Delta))), ] > write.table(pseudo.hist, file = "pseudo-hist....
2001 Dec 07
2
Memory problem
Dear all, I have written a little R program to convert images. See below. Within the loop over j (the filenames) memory consumption grows constantly. rm( ... ) inside the loop did not help. Memory does not grow if I remove the writeBin statements between the two #-------- marks. But obviously this is not solution I want... Thanks for any advice. Manfred Baumstark P.S. As I'm new to R:
2002 Oct 14
1
R 1.6.0 Solaris crash with xmalloc: out of virtual memory
...ofile() returns: NilSXP SymSXP ListSXP CloSXP EnvSXP PromSXP LangSXP SpecialSXP 1 4919 128880 1440 13 18 63607 59 BUILTINSXP CHARSXP LGLSXP - - INTSXP REALSXP CPLXSXP STRSXP 513 37178 1712 0 0 237 9047 8 10201 DOTSXP ANYSXP VECSXP EXPRSXP - EXTPTRSXP WEAKREFSXP 1 0 341 2 0 0 0 ---------------- Just before the crash ------------ --- gc() returns: used (Mb) gc trigger (Mb) Ncells 347539 9.3 597831 16.0 Vcells 566319 4.4 1103261 8.5 --- memory.profile() returns: NilSXP SymSXP ListSXP CloS...
2004 Oct 30
1
Destructive str(...)?
I have encountered a strange behavior of the str function - it seems to modify the object that is displayed. Probably I'm using something unsupported (objects consisting just of an external reference), but still I'm curious as of why this happens. I create (in C code) EXTPTRSXP and associate a class to it via SET_CLASS. Such objects works fine until it's passed to str as the following output demonstrates: > c<-.MCall("RController","getRController") > c [1] "<RController: 0x3be5d0>" > str(c) Class 'ObjCid' le...
2011 Apr 26
1
Hook into Coercion Framework for data.frame
Hi, I am looking into a way to hook into the R coercion framework to allow me to convert table-like data stored within a COM object into a data.frame. Some of our COM objects have their own table-like data storage, and from R's point of view it's an object (EXTPTRSXP) decoarated with a sepcial symbol so we can easily identify it. COM_Table <- a_method_that_creates_the_object() class(COM_TABLE) > "QS.IpdgRelation" In addition, we have a method that transforms this object into a data.frame: relation.to.data.frame <- function(obj) { ... }...
2005 Jan 03
2
Memory problem ... Again
...P CHARSXP LGLSXP INTSXP 203 1168 111430 5296 0 0 44650 REALSXP CPLXSXP STRSXP DOTSXP ANYSXP VECSXP EXPRSXP 13382 9 60170 0 0 26003 0 BCODESXP EXTPTRSXP WEAKREFSXP 0 106 0
2004 Dec 28
2
Configuration of memory usage
...P CHARSXP LGLSXP INTSXP 203 1168 111434 5296 0 0 44649 REALSXP CPLXSXP STRSXP DOTSXP ANYSXP VECSXP EXPRSXP 13382 9 60173 0 0 26002 0 BCODESXP EXTPTRSXP WEAKREFSXP 0 106 0 Although I have no idea of memory allocation in R, apparently something's wrong with this. The memory problem must have nothing to do with physical memory. My question is this. Is this memory problem due to some non-optimal configuration of memory us...
2005 Feb 04
1
Keeping the data of C structure in R variables?..
Dear all, does anybody know if there is a way to implement the following idea: if for example I have a C/C++ structure of form: struct { int size; char * data; } SData; in C code I could create some implementation that would create this structure by pointer and fill in the data, so I would have a variable something like SData* myData; Now what I need is to pass this data to a
2005 Feb 04
1
Keeping the data of C structure in R variables?..
Dear all, does anybody know if there is a way to implement the following idea: if for example I have a C/C++ structure of form: struct { int size; char * data; } SData; in C code I could create some implementation that would create this structure by pointer and fill in the data, so I would have a variable something like SData* myData; Now what I need is to pass this data to a
2011 Jun 04
2
Interfacing a C++ class
Hello Apologies for cross-posting, the discussion should (if) go to R-devel, but I also want to reach the rcpp-devel people. My C++ class FOO is a module available through Rcpp, and it works fine and is -- so far -- bug free. With trying to further develop my R package, I thought it was a good idea to interface my C++ workhorse FOO with an S4 class Foo. After some long and not always insightful
2010 Apr 19
1
transient memory allocation and external pointers
Hello, The Writing R extensions manual section 6.1.1 describes the transient memory allocation function R_alloc, and states that memory allocated by R_alloc is automatically freed after the .C or .Call function is completed. However, based on my understanding of R's memory handling, as well as some test functions I have written, I suspect that this is not quite accurate. If the .Call
2013 Jan 04
0
Solved Re: Garbage collection problem
...he values returned by gc(), correct? The opposite is happening in my case. > > The calculation is of the size of the object, and excludes the space needed > to store its name in the symbol table. > > Associated space (e.g. the environment of a function and what the pointer in > a EXTPTRSXP points to) is not included in the calculation." > > For a simple example: > >> x <- 1:1000000 >> object.size(x) > 4000024 bytes >> e <- new.env() >> object.size(e) > 28 bytes >> e$x <- x >> object.size(e) > 28 bytes > > At th...
2002 Aug 06
2
Memory leak in R v1.5.1?
...XP CHARSXP LGLSXP INTSXP 59 503 29179 1682 0 0 24 REALSXP CPLXSXP STRSXP DOTSXP ANYSXP VECSXP EXPRSXP 135616 8 23982 0 0 16053 0 EXTPTRSXP WEAKREFSXP 0 0 0 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body",...
2009 Dec 16
2
What is the fastest way to see what are in an RData file?
Currently, I load the RData file then ls() and str(). But loading the file takes too long if the file is big. Most of the time, I only interested what the variables are in the the file and the attributes of the variables (like if it is a data.frame, matrix, what are the colnames/rownames, etc.) I'm wondering if there is any facility in R to help me avoid loading the whole file.
2011 Sep 20
2
Is it possible to pass a function argument from R to compiled code in C?
I have a function in R that takes another function as argument: f <- function(g, ...) { #g is expected to be a function } I want to see if there is a way to implement "f" in C and calling it from R using ".C" interface. I know that I can use function pointers for my C implementation, but I imagine it's going to be nearly impossible to pass a function from R to C. Are
2013 Jan 04
1
Garbage collection problem
Hello all, I am running into a problem with garbage collection not being able to free up all memory. Unfortunately I am unable to provide a minimal self-contained example, although I can provide a self contained example if anyone feels like wading through some 600 lines of code. I would love to isolate the relevant parts from the code but whenever I try to run a simpler example, the problem does
2010 May 17
0
Rcpp 0.8.0 on CRAN
...P | Rcpp::Language LISTSXP | Rcpp::Pairlist ---------------------------------------------------------- S4SXP | Rcpp::S4 ---------------------------------------------------------- PROMSXP | Rcpp::Promise WEAKREFSXP | Rcpp::WeakReference EXTPTRSXP | template <typename T> Rcpp::XPtr ---------------------------------------------------------- Some SEXP types do not have dedicated Rcpp classes : NILSXP, DOTSXP, ANYSXP, BCODESXP and CHARSXP. Still missing are a few convenience classes such as Rcpp::Date or Rcpp::Datetime whic...