Re: [R-pkg-devel] Order of repo access from options("repos")

2024-04-02 Thread Jan van der Laan
Interesting. That would also mean that putting a company repo first does not protect against dependency confusion attacks (people intentionally uploading packages with the same name as company internal packages on CRAN;

Re: [R-pkg-devel] Package required but not available: ‘arrow’

2024-02-22 Thread Jan van der Laan
This error indicates that the arrow package is unavailable on the system where your package is checked. At https://cran.r-project.org/web/checks/check_results_arrow.html you can see that the arrow package is currently not working with clang on fedora an debian. This is not something that you

Re: [R-pkg-devel] Question regarding finding the source file location without R-packages outside of R-Studio

2023-11-23 Thread Jan van der Laan
Can't/don't you use relative paths? library(..., lib.loc = "./MyLibrary") Then your project is perfectly portable. The only thing you need to take care of is to run your code from your project directory. In R-studio this is easily done by using projects. Outside of R-studio it depends on

Re: [R-pkg-devel] Too many cores used in examples (not caused by data.table)

2023-10-24 Thread Jan van der Laan
You are not the only one; I did the same with some of my examples. Would it be an option to ask for a default R-option, 'max.ncores', that specifies the maximum number of cores a process is allowed to use? CRAN could then require that that examples, tests and vignettes respect this option.

[R-pkg-devel] Issue with CPU time > 2.5 times elapsed time

2023-07-16 Thread Jan van der Laan
I am trying to upload a new version of the reclin2 package, but it fails the pre-tests on Debian with the following message: > * checking examples ... [14s/4s] NOTE > Examples with CPU time > 2.5 times elapsed time > user system elapsed ratio > select_threshold 3.700 0.122

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

2023-06-21 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

Re: [R-pkg-devel] Read and restore .Random.seed in package

2022-09-19 Thread Jan van der Laan
Sep 2022, Jan van der Laan wrote: I have a function in which I need to draw some random numbers. However, for some use cases, it is necessary that the same random numbers are drawn (when the input is the same) [1]. So I would like to do a set.seed in my function. This could, however, mess up

[R-pkg-devel] Read and restore .Random.seed in package

2022-09-19 Thread Jan van der Laan
I have a function in which I need to draw some random numbers. However, for some use cases, it is necessary that the same random numbers are drawn (when the input is the same) [1]. So I would like to do a set.seed in my function. This could, however, mess up the seed set by the user. So

Re: [R-pkg-devel] Tests run without --as-cran and not with

2021-10-01 Thread Jan van der Laan
weird errors when people have multiple versions of R on their system. Best, Jan On 30-09-2021 18:59, Ivan Krylov wrote: On Fri, 24 Sep 2021 21:48:12 +0200 Jan van der Laan wrote: my tests run fine when run with R CMD check, but not with R CMD check --as-cran <...> pandoc then c

[R-pkg-devel] Tests run without --as-cran and not with

2021-09-24 Thread Jan van der Laan
I am trying solve an issue where my tests run fine when run with R CMD check, but not with R CMD check --as-cran. In the tests pandoc is called using system; pandoc then calls R again with a script which is part of the package. The last part seems to fail, see error message below:

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 limit

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] Run garbage collector when too many open files

2018-08-07 Thread Jan van der Laan
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 Martin Meachler suggested

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

2018-08-07 Thread Jan van der Laan
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 from c++, handles to them are returned to R

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

2018-08-07 Thread Jan van der Laan
In my package I open handles to temporary files from c++, handles to them are returned to R through vptr objects. The files are deleted then the corresponding R-object is deleted and the garbage collector runs: a <- lvec(10, "integer") rm(a) Then when the garbage collector runs the file

[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)

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:

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,

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

[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,

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

2015-05-20 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 |

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 rh...@eoos.dds.nl 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

[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

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

2015-05-13 Thread Jan van der Laan
Dirk Eddelbuettel e...@debian.org 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

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 CRAN

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

[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

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 rip...@stats.ox.ac.uk schreef: On 24/05/2013 07:53, Jan van der Laan wrote: I am trying to use R_RegisterCFinalizerEx to ensure some c

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

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 simon.urba...@r-project.org 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/sys-std.c. I'll get back

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

2010-07-22 Thread Jan van der Laan
still have to run handlers manually (note that you don't need PolledEvents anymore since they are part of the handlers). Cheers, Simon On Wednesday 21 July 2010, Jan van der Laan wrote: How do I ensure that the windows keep being updated? in RKWard we run the following periodically

[Rd] Plot window does not update in embedded code

2010-07-21 Thread Jan van der Laan
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 iostream #include iomanip #include string static void R_WriteConsoleEx (const char *buf, int buflen, int otype