Re: [Rd] Getting error in rbindlist

2019-11-01 Thread Hugh Parsonage
This is (was) a bug in data.table that is similar to one which was putatively closed. Recommend you update to the latest version and if the problem persists reopen the issue here https://github.com/Rdatatable/data.table/issues/3032 This mailing list is for R bugs, which this isn’t. R Core can no m

Re: [Rd] Getting error in rbindlist

2019-11-01 Thread Tomas Kalibera
On 11/1/19 5:24 PM, Anshul Saravgi wrote: > Thanks Tomas for identifying the bug. > > *How to resolve this bug? Can you please help me here?* I would recommend you first try to create a complete reproducible example (the code below is just a snippet). Then try to minimize it - make it do as litt

Re: [Rd] Getting error in rbindlist

2019-11-01 Thread Tomas Kalibera
On 11/1/19 1:11 PM, Anshul Saravgi wrote: Hi All Can you help me understand the meaning of the below error message then I will try to figure out what is going wrong: *Input Code:* bodlane2 <- lapply( + lapply(split(lctolc2, lctolc2$Item), function(x) graph.data.frame(x[, 2:3])), + functio

[Rd] Getting error in rbindlist

2019-11-01 Thread Anshul Saravgi
Hi All Can you help me understand the meaning of the below error message then I will try to figure out what is going wrong: *Input Code:* > bodlane2 <- lapply( + lapply(split(lctolc2, lctolc2$Item), function(x) graph.data.frame(x[, 2:3])), + function(x) lapply( + V(x)[degree(x, mode = "in

Re: [Rd] [External] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Jan Gorecki
Thank you all for your valuable comments. Best, Jan On Fri, Nov 1, 2019 at 8:15 PM Tierney, Luke wrote: > > On Fri, 1 Nov 2019, Jan Gorecki wrote: > > > Thank you Luke. > > That is why I don't use Rf_inherits but INHERITS which does not > > allocate, provided in the email body. > > Your definitio

Re: [Rd] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Michael Lawrence via R-devel
If your goal is to perform multithreaded computations, why not perform all necessary interactions with R upfront and then compute only on primitives? It would help for us to understand your use case. On Fri, Nov 1, 2019 at 4:26 AM Jan Gorecki wrote: > > Dear R developers, > > Motivated by discuss

Re: [Rd] [External] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Tierney, Luke
On Fri, 1 Nov 2019, Jan Gorecki wrote: > Thank you Luke. > That is why I don't use Rf_inherits but INHERITS which does not > allocate, provided in the email body. Your definition can allocate because STING_ELT can allocate. getAttrib can GC in general. Currently it would not GC or allocate in thi

Re: [Rd] [External] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Simon Urbanek
Note that your desire is by definition impossible - as your example also shows checking for S4 inheritance involves evaluation and thus allocation which cannot be avoided by the dynamic design of S4 inheritance. Cheers, Simon > On Nov 1, 2019, at 9:23 AM, Jan Gorecki wrote: > > Thank you Luk

Re: [Rd] [External] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Gábor Csárdi
AFAIR getAttrib() can allocate as well. Also, R API functions that do not allocate today, may allocate in the future. Gabor On Fri, Nov 1, 2019 at 1:24 PM Jan Gorecki wrote: > > Thank you Luke. > That is why I don't use Rf_inherits but INHERITS which does not > allocate, provided in the email bo

Re: [Rd] [External] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Jan Gorecki
Thank you Luke. That is why I don't use Rf_inherits but INHERITS which does not allocate, provided in the email body. I cannot do similarly for S4 classes, thus asking for some API for that. On Fri, Nov 1, 2019 at 5:56 PM Tierney, Luke wrote: > > On Fri, 1 Nov 2019, Jan Gorecki wrote: > > > Dear

Re: [Rd] [External] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Tierney, Luke
On Fri, 1 Nov 2019, Jan Gorecki wrote: > Dear R developers, > > Motivated by discussion about checking inheritance of S3 and S4 > objects (in head matrix/array topic) I would light to shed some light > on a minor gap about that matter in R C API. > Currently we are able to check inheritance for S3

[Rd] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Jan Gorecki
Dear R developers, Motivated by discussion about checking inheritance of S3 and S4 objects (in head matrix/array topic) I would light to shed some light on a minor gap about that matter in R C API. Currently we are able to check inheritance for S3 class objects from C in a robust way (no allocatio

Re: [Rd] head.matrix can return 1000s of columns -- limit to n or add new argument?

2019-11-01 Thread Martin Maechler
> peter dalgaard > on Thu, 31 Oct 2019 23:04:29 +0100 writes: > Hmm, the problem I see here is that these implied classes are all inherently one-off. We also have >> inherits(matrix(1,1,1),"numeric") > [1] FALSE >> is.numeric(matrix(1,1,1)) > [1] TRUE >> inhe

Re: [Rd] head.matrix can return 1000s of columns -- limit to n or add new argument?

2019-11-01 Thread Martin Maechler
> Pages, Herve > on Thu, 31 Oct 2019 21:02:07 + writes: > On 10/30/19 04:29, Martin Maechler wrote: >>> Gabriel Becker >>> on Tue, 29 Oct 2019 12:43:15 -0700 writes: >> >> > Hi all, >> > So I've started working on this and I ran into something that