search for: listsxps

Displaying 20 results from an estimated 73 matches for "listsxps".

Did you mean: listsxp
2024 Jul 06
1
API for converting LANGSXP to LISTSXP?
...y intended to replace the uses of SET_TYPEOF(allocList(...), LANGSXP) with allocLang(...). At least it's easy to manually convert between the two by replacing the head of the list using LCONS(CAR(list), CDR(list)) or CONS(CAR(lang), CDR(lang)): in a call, the rest of the arguments are ordinary LISTSXPs. -- Best regards, Ivan
2024 Jul 05
2
API for converting LANGSXP to LISTSXP?
Hi, A common idiom in the R sources is to convert objects between LANGSXP and LISTSXP by using SET_TYPEOF. However, this is soon going to be disallowed in packages. From what I can see, there isn't currently a direct way to convert between these two object types using the available API. At the R level, one can convert calls to pairlists with: >
2020 Sep 06
8
some questions about R internal SEXP types
Hello, I am writing an R/Go interoperability tool[1] that work similarly to Rcpp; the tool takes packages written in Go and performs the necessary Go type analysis to wrap the Go code with C and R shims that allow the Go code to then be called from R. The system is largely complete (with the exception of having a clean approach to handling generalised attributes in the easy case[2] - the less
2004 Jul 06
1
Wrong object type produced - LANGSXP should be LISTSXP (PR#7055)
Full_Name: David Bauer Version: 1.9 OS: Linux Submission from: (NULL) (160.91.245.8) In the file gram.y, the xxsubscript function generates a LANGSXP with another LANGSXP as its CDR. I believe that this is a mistake and that the second LANGSXP should be a LISTSXP. The inputs a1, a3 are parameters to the subscript function (a2), and as such they should be in a dotted-pair list. David Bauer
2006 Jun 03
3
More on bug 7924
Hi, Again, sorry for the length of this post. Once I get my new office I will get a website set up on my work machine and will simply post a link to the log since I doubt many people are truly interested in these logs. To further analyze what is happening, I added my own routine in main.c called DEBUG_SET_NAMED and then redefined the SET_NAMED macro to use it and then rebuilt R. I
1998 Jun 04
1
aov
R developers, Last week I asked several questions which I think I can now answer myself in large part. > > Q 1) Is aov supposed to avoid qr decomposition and matrix inversion? > In S it is claimed to be faster than lm() for large datasets. Is > that due to avoidance of qr()? > (My main goal is to get the Error strata working.) My use of matrix
2020 Sep 08
0
some questions about R internal SEXP types
The general principle is that R packages are only allowed to use what is documented in the R help (? command) and in Writing R Extensions. The former covers what is allowed from R code in extensions, the latter mostly what is allowed from C code in extensions (with some references to Fortran). If you are implementing a Go interface for writing R packages, such Go interface should thus only
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?
2020 Sep 08
0
some questions about R internal SEXP types
On 9/8/20 11:47 AM, Dan Kortschak wrote: > Thanks, Tomas. > > This is unfortunate. Calling between Go and C is not cheap; the gc > implementation of the Go compiler (as opposed to gccgo) uses different > calling conventions from C and there are checks to ensure that Go > allocated memory pointers do not leak into C code. For this reason I > wanted to avoid these if at all
2019 Jul 17
2
ALTREP wrappers and factors
Hello, I?m experimenting with ALTREP and was wondering if there is a preferred way to create an ALTREP wrapper vector without using .Internal(wrap_meta(?)), which R CMD check doesn?t like since it uses an .Internal() function. I was trying to create a factor that used an ALTREP integer, but attempting to set the class and levels attributes always ended up duplicating and materializing the
2019 Jul 18
0
ALTREP wrappers and factors
Hi Kylie, For your question, I don't think a wrapper can completely solve your problem. The duplication occurs since your variable y has more than 1 reference number( Please see highlighted), so even you have a wrapper, any changes on the value of the wrapper still can trigger the duplication. > .Internal(inspect(y)) > @7fb0ce78c0f0 13 INTSXP g0c0 *[NAM(7)]* matter vector (mode=3,
2003 Dec 16
1
Memory issues in "aggregate" (PR#5829)
Full_Name: Ed Borasky Version: 1.8.1 OS: Windows XP Professional Submission from: (NULL) (208.252.96.195) R 1.8.1 seems to be running into a memory allocation problem in the "aggregate" function. I have a rather large dataset (14 columns by 223,000 rows -- almost 40 megabytes) and a script that performs some processing on it. The system is a 768 MB Pentium 4. Here's the console
2016 May 20
2
identical on closures
Specifically, the srcfile attribute of the srcref attribute of the two instances of the functions contain different environments, AFAICT. Environments are compared only by exact pointer, so this forces return FALSE. Snippets from .Internal(inspect(x)) and .Internal(inspect(y)): @cca008 03 CLOSXP g0c0 [MARK,NAM(2),ATT] FORMALS: @604b58 00 NILSXP g0c0 [MARK,NAM(2)] BODY: @cc9650 06 LANGSXP
2016 May 20
2
identical on closures
I'm confused by this: > identical(function() {}, function() {}) [1] FALSE Yet, after loading the Matrix package (which redefines det), the following is checked (in library.checkConflicts): > identical(get("det", baseenv()), get("det", asNamespace("Matrix")), ignore.environment=T) [1] TRUE I've looked at the code in identical.c and for closures it
2005 Jun 29
1
Viewing R objects in gdb
I'm trying to track down a bug in some experimental code, where an object's attribute is getting messed up. This means I'd like to examine R objects while within gdb. One of the things I'd like to do is to examine the names of all the attributes. This is exactly what an example in the R Extensions manual section 4.11.2 "Inspecting R objects when debugging" does,
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:
2010 Nov 15
1
SEXP and slots
Hello, Since people have whisperred about Rcpp, I'd like to play too. > On 11/15/2010 07:45 AM, Patrick Leyshock wrote: >> Very helpful, thank you. >> >> A couple other questions, please: >> >> 1. I've got a function written in C, named "my_c_function". In my R >> code I call this function, passing to it an INTSXP and a STRSXP, >>
2002 Oct 14
1
R 1.6.0 Solaris crash with xmalloc: out of virtual memory
[some de-capitalization of *SXP done manually by mailing list maintainer ; the originally was caught as potential spam. MM] I have a little R program that crashes with the message xmalloc: out of virtual memory The code has a repeat{} loop that watches the sizes of some files. When there's an increase it updates things by reading the last 65 lines of each file, doing some
2009 Jul 05
3
Memory management issues
Hi everybody, I have been interfacing some C++ library code into an R package but ran into optimization issues specific to memory management that require some insight into the GC. One of the C++ libraries returns simple vectors of integers, doubles and complex which are allocated and managed from the library itself. I cannot know the length of the array beforehand, so I cannot pre-allocate that
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