[Rd] Run garbage collector when too many open files

2018-08-07 Thread Jan van der Laan
In my package [1] I open handles to temporary files from c++, pointer to the objects containing those handles are returned to R as external pointer objects. The files are deleted when the corresponding R-object is deleted and the garbage collector runs: a <- lvec(10, "integer") rm(a) Then

Re: [Rd] [R-pkg-devel] Run garbage collector when too many open files

2018-08-07 Thread Jan van der Laan
pt in memory. But that is only a partial solution. On 07-08-18 15:24, Uwe Ligges wrote: Why not add functionality that allows to delete object + runs cleanup code? Best, Uwe Ligges On 07.08.2018 14:26, Jan van der Laan wrote: In my package I open handles to temporary files

Re: [Rd] Run garbage collector when too many open files

2018-08-07 Thread Jan van der Laan
fficult for the package to detect which objects that will be. I would have to write my own 'garbage collector'. Best, Uwe Best, luke On Tue, 7 Aug 2018, Jan van der Laan wrote: Dear Uwe, (When replying to your message, I sent the reply to r-devel and not r-package-devel, as Marti

[Rd] Plot window does not update in embedded code

2010-07-21 Thread Jan van der Laan
orking under Linux. However, I also want to be able to run my code under windows, so I hope there is a cross-platform solution. Thanks in advance. Regards, Jan van der Laan = The example code = #include #include #include static void R_WriteConsoleEx (const char *buf, int buflen, int

Re: [Rd] Plot window does not update in embedded code

2010-07-22 Thread Jan van der Laan
efactorization the > handlers are still-unix specific so I stand corrected and you still have to > run handlers manually (note that you don't need PolledEvents anymore since > they are part of the handlers). > > Cheers, > Simon > > >>> >>> On Wedn

Re: [Rd] Plot window does not update in embedded code

2010-07-28 Thread Jan van der Laan
On Thu, Jul 22, 2010 at 4:06 PM, Simon Urbanek wrote: > > On Jul 22, 2010, at 3:31 AM, Jan van der Laan wrote: > >> Thomas, Simon, >> >> Thank you for your answers. I will have a look at the code Thomas gave >> me and probably also have another look at src/unix/s

[Rd] Using response variable in interaction as explanatory variable in glm crashes R

2017-10-06 Thread Jan van der Laan
The following code crashes R (I know I shouldn't try to estimate such a model; this was a bug in some code of mine). I also tried with R-devel; same result. tab <- structure(list(dob_day = c(FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE), dob_mon = c(FALSE, FALSE, TRUE, TRUE, FALSE, FAL

Re: [Rd] Using response variable in interaction as explanatory variable in glm crashes R

2017-10-06 Thread Jan van der Laan
It is actually model.matrix that crashes, not glm. Same crash occurs with e.g. lm. model.matrix(dob_mon ~ dob_day*dob_mon, data = tab) also crashes R. Jan On 06-10-17 12:08, Jan van der Laan wrote: The following code crashes R (I know I shouldn't try to estimate such a model; this

Re: [Rd] How to create a table structure in Java code?

2017-10-26 Thread Jan van der Laan
I suspect that you are looking for something like: read.csv(textConnection( "5.1,3.5,1.4,0.2,setosa 4.9,3,1.4,0.2,setosa 4.7,3.2,1.3,0.2,setosa 4.6,3.1,1.5,0.2,setosa 5,3.6,1.4,0.2,setosa" ), header = FALSE) HTH, Jan On 25-10-17 12:50, Morkus via R-devel wrote: Hi all, Using RConsole, it's

Re: [Rd] How to create a table structure in Java code?

2017-10-26 Thread Jan van der Laan
As Joris mentioned this question does not belong on R-devel, but on R-help. When replying to your earlier question I missed that I was replying to R-devel and not R-help. R-devel: sorry for that. So, please post any follow up questions to R-help. -- Jan On 26-10-17 15:59, Morkus wrote: *_T

Re: [Rd] New pipe operator

2020-12-09 Thread Jan van der Laan
On 08-12-2020 12:46, Gabor Grothendieck wrote: Duncan Murdoch: I agree it's all about call expressions, but they aren't all being treated equally: x |> f(...) expands to f(x, ...), while x |> `function`(...) expands to `function`(...)(x). This is an exception to the rule for Yes, this

Re: [Rd] New pipe operator

2020-12-09 Thread Jan van der Laan
On 09-12-2020 16:20, Duncan Murdoch wrote: On 09/12/2020 9:55 a.m., Jan van der Laan wrote: I think only allowing functions on the right hand side (e.g. only the |> operator and not the |:>) would be enough to handle most cases and seems easier to reason about. The limitations o

Re: [Rd] New behavior when running script in package directory?

2023-06-20 Thread Jan van der Laan
Could there be a .Rprofile or .RData file in the directory where you start R? These are run/loaded when you start R when present (with the default arguments when starting R). HTH, Jan On 20-06-2023 23:38, Dominick Samperi wrote: When I run a script foo.R containing some trivial code in m

[Rd] Large vector support in data.frames

2024-06-19 Thread Jan van der Laan
What is the status of supporting long vectors in data.frames (e.g. data.frames with more than 2^31 records)? Is this something that is being worked on? Is there a time line for this? Is this something I can contribute to? I now regularly work with datasets with more than 2^31 records and no

Re: [Rd] Large vector support in data.frames

2024-07-03 Thread Jan van der Laan
vel wrote: В Wed, 19 Jun 2024 09:52:20 +0200 Jan van der Laan пишет: What is the status of supporting long vectors in data.frames (e.g. data.frames with more than 2^31 records)? Is this something that is being worked on? Is there a time line for this? Is this something I can contribute to? Apolog

Re: [Rd] Request for help with UBSAN and total absense of CRAN response

2015-01-16 Thread Jan van der Laan
Dirk, The vagrant setup I use to test my packages with UBSAN also seems to replicate the error reported by CRAN (together with some other warnings). I have attached the files (I hope they get through the filters). I suppose you know what to do with them. Jan Dirk Eddelbuettel schree

Re: [Rd] Request for help with UBSAN and total absense of CRAN response

2015-01-17 Thread Jan van der Laan
... and they didn't make it through. I put the files in a gist: https://gist.github.com/djvanderlaan/1e9beb75d2d595824efc Jan On 16-01-15 15:21, Jan van der Laan wrote: Dirk, The vagrant setup I use to test my packages with UBSAN also seems to replicate the error reported by

[Rd] Alternative for wildcard gnu extension in Makevars

2015-05-13 Thread Jan van der Laan
I have some cpp-files from another library (boost) in a subdirectory in my src directory (src/boost_src). I include these using the following two lines in my Makevars: SOURCES = $(wildcard *.cpp boost_src/*.cpp) OBJECTS = $(SOURCES:.cpp=.o) However, R CMD check complains about my use of 'w

Re: [Rd] Alternative for wildcard gnu extension in Makevars

2015-05-13 Thread Jan van der Laan
Dirk Eddelbuettel schreef: On 13 May 2015 at 17:27, Jan van der Laan wrote: | | I have some cpp-files from another library (boost) in a subdirectory | in my src directory (src/boost_src). I include these using the | following two lines in my Makevars: | | SOURCES = $(wildcard *.cpp boost_src

Re: [Rd] Alternative for wildcard gnu extension in Makevars

2015-05-13 Thread Jan van der Laan
On 13-05-15 18:08, Gábor Csárdi wrote: On Wed, May 13, 2015 at 12:05 PM, Jan van der Laan mailto:rh...@eoos.dds.nl>> wrote: [...] Too bad. Since it is only a handful of files, I will probably move them directly into the src directory and prefix them. It would have been n

Re: [Rd] Alternative for wildcard gnu extension in Makevars

2015-05-19 Thread Jan van der Laan
On 13-05-15 19:45, Dirk Eddelbuettel wrote: On 13 May 2015 at 10:10, Kevin Ushey wrote: | One other solution that's only a little crazy: you could have a R | function within your package that generates the appropriate (portable) | Makevars, and within the package `configure` script call that |

[Rd] Problem with Rboolean in c++ code

2013-05-24 Thread Jan van der Laan
I am trying to use R_RegisterCFinalizerEx to ensure some c++ object is properly deleted after use. However, I run into some problems when trying to pass in the third argument which is an Rboolean. The line 'R_RegisterCFinalizerEx(p, finalizer, TRUE);' generates the following error when t

Re: [Rd] Problem with Rboolean in c++ code

2013-05-24 Thread Jan van der Laan
Rinternals.h. Now that I reread it again, I can see a slight preference for Rdefines.h, but you really have to read closely. Thanks again. Jan Prof Brian Ripley schreef: On 24/05/2013 07:53, Jan van der Laan wrote: I am trying to use R_RegisterCFinalizerEx to ensure some c++ object is properly

Re: [Rd] Problem with Rboolean in c++ code

2013-05-24 Thread Jan van der Laan
On 05/24/2013 05:02 PM, Prof Brian Ripley wrote: On 24/05/2013 15:55, Jan van der Laan wrote: Thanks. That does the trick. Although I now have to rewrite some other stuff, but I have just started so better now than later. To be honest, a first and even a second read of the r-extensions