[Rd] Get list of active calling handlers?

2024-02-06 Thread Duncan Murdoch
The SO post https://stackoverflow.com/q/77943180 tried to call globalCallingHandlers() from a function, and it failed with the error message "should not be called with handlers on the stack". A much simpler illustration of the same error comes from this line:

Re: [Rd] Get memory address of an R data frame

2020-01-10 Thread Dirk Eddelbuettel
lille stor, As a general rule, please do not cross-post. And almost certainly do not simultaneously as you did here and on https://stackoverflow.com/questions/59663174/get-memory-address-of-an-r-data-frame Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

Re: [Rd] Get memory address of an R data frame

2020-01-09 Thread Pages, Herve
On 1/9/20 06:56, Stepan wrote: > On 09. 01. 20 15:41, lille stor wrote: > >> I believe this could be done without creating side effects (e.g. >> crash) as we are just talking about changing values. A crash would certainly be an annoying "side effect" ;-) As Stepan explained, data.frame objects

Re: [Rd] Get memory address of an R data frame

2020-01-09 Thread Stepan
On 09. 01. 20 15:41, lille stor wrote: I believe this could be done without creating side effects (e.g. crash) as we are just talking about changing values. that is exactly the issue that my last two points warn about. Example: a <- mtcars .Call("my_innocent_function", a) Would you expect

Re: [Rd] Get memory address of an R data frame

2020-01-09 Thread Tomas Kalibera
On 1/9/20 1:03 PM, Ezra Tucker wrote: Hi Lille, Is it possible you're looking for tracemem() or inspect() ? Please note these functions are only for debugging. They should never be called from programs or packages. One should never try to manipulate pointers from R directly or even hold

Re: [Rd] Get memory address of an R data frame

2020-01-09 Thread Stepan
Hello Lille, raw data of a data.frame (or more precisely a list, because data.frame is just a list with "data.frame" class) is an array of R specific data structures (SEXP), so a generic C function will not be able to work with them. As a per-processing step, you may allocate an array for

Re: [Rd] Get memory address of an R data frame

2020-01-09 Thread Joris Meys
Hi Lille, To my understanding, there's no need to get the actual memory address of the R data frame, as using .Call() or .External() can be used in a "call by reference" way as well. This would be contrary to standard R behaviour, so if you use that in a package, make sure you indicate this!

Re: [Rd] Get memory address of an R data frame

2020-01-09 Thread Ezra Tucker
Hi Lille, Is it possible you're looking for tracemem() or inspect() ? > x <- data.frame(z = 1:10)> tracemem(x)[1] "<0x55aa743e0bc0>" > x[1] <- 2Ltracemem[0x55aa743e0bc0 -> 0x55aa778f6ad0]: tracemem[0x55aa778f6ad0 -> 0x55aa778f6868]: [<-.data.frame [<- tracemem[0x55aa778f6868 -> 0x55aa778f5b48]:

[Rd] Get memory address of an R data frame

2020-01-09 Thread lille stor
Hello, I would like for my C function to be able to manipulate some values stored in an R data frame. To achieve this, a need the (real) memory address where the R data frame stores its data (hopefully in a contiguous way). Then, from R, I call the C function and passing this memory address

Re: [Rd] Get Logical processor count correctly whether NUMA is enabled or disabled

2018-09-03 Thread Srinivasan, Arunkumar
Tomas, Luke, thank you very much once again for patching both issues swiftly. This’ll be incredibly valuable to us once we move to 3.6.0. From: Tomas Kalibera Sent: 03 September 2018 13:07 To: r-devel@r-project.org Cc: Srinivasan, Arunkumar Subject: Re: [Rd] Get Logical processor count

Re: [Rd] Get Logical processor count correctly whether NUMA is enabled or disabled

2018-09-03 Thread Tomas Kalibera
ike we are still not being able to use >64 processors all at the > same time even if detectCores() returns the right count now. > > I'd appreciate your thoughts on this. > > Best, > Arun. > > -Original Message- > From: Tomas Kalibera > Sent: 27 Au

Re: [Rd] Get Logical processor count correctly whether NUMA is enabled or disabled

2018-08-29 Thread Srinivasan, Arunkumar
not being able to use >64 processors all at the same time even if detectCores() returns the right count now. I'd appreciate your thoughts on this. Best, Arun. -Original Message- From: Tomas Kalibera Sent: 27 August 2018 19:43 To: Srinivasan, Arunkumar ; r-devel@r-project.org

Re: [Rd] Get Logical processor count correctly whether NUMA is enabled or disabled

2018-08-27 Thread Tomas Kalibera
processes in R instead of allowing a single process to use all cores. Apologies if this is utterly irrelevant. Thank you, Arun. From: Tomas Kalibera Sent: 21 August 2018 11:50 To: Srinivasan, Arunkumar ; r-devel@r-project.org Subject: Re: [Rd] Get Logical processor count correctly whethe

Re: [Rd] Get Logical processor count correctly whether NUMA is enabled or disabled

2018-08-21 Thread Srinivasan, Arunkumar
https://github.com/axboe/fio/issues/527 and is addressed - https://github.com/axboe/fio/blob/c479640d6208236744f0562b1e79535eec290e2b/os/os-windows-7.h . I am not sure though if this is entirely relevant since we would be forking new processes in R instead of allowing a single process to use al

Re: [Rd] Get Logical processor count correctly whether NUMA is enabled or disabled

2018-08-21 Thread Tomas Kalibera
Dear Arun, thank you for the report. I agree with the analysis, detectCores() will only report logical processors in the NUMA group in which R is running. I don't have a system to test on, could you please check these workarounds for me on your systems? # number of logical processors - what

[Rd] Get Logical processor count correctly whether NUMA is enabled or disabled

2018-08-17 Thread Srinivasan, Arunkumar
Dear R-devel list, R's detectCores() function internally calls "ncpus" function to get the total number of logical processors. However, this doesnot seem to take NUMA into account on Windows machines. On a machine having 48 processors (24 cores) in total and windows server 2012 installed, if

[Rd] Get the tail of a list in C

2013-07-05 Thread maxpar
Hi, I am write R extensions in C. Now I have a VECSXP variable, so how can I get the tail of it (all but the first one) as a new VECSXP. I tried CDR(), but it gives error. Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Get-the-tail-of-a-list-in-C-tp4670900.html

Re: [Rd] Get the tail of a list in C

2013-07-05 Thread romain
Le 2013-07-05 07:15, maxpar a écrit : Hi, I am write R extensions in C. Now I have a VECSXP variable, so how can I get the tail of it (all but the first one) as a new VECSXP. I tried CDR(), but it gives error. Thanks. Hello, A VECSXP is actually an array of pointers, not a linked list.

Re: [Rd] Get the tail of a list in C

2013-07-05 Thread maxpar
Thanks. Got it. I need differentiate pairlist and list. -- View this message in context: http://r.789695.n4.nabble.com/Get-the-tail-of-a-list-in-C-tp4670900p4670958.html Sent from the R devel mailing list archive at Nabble.com. __

[Rd] get and exists are not vectorized

2013-02-12 Thread Patrick Burns
Here is the current behavior (in 2.15.2 and 3.0.0): exists(c('notLikely', 'exists')) [1] FALSE exists(c('exists', 'notLikely')) [1] TRUE get(c('notLikely', 'exists')) Error in get(c(notLikely, exists)) : object 'notLikely' not found get(c('exists', 'notLikely')) function (x, where = -1,

Re: [Rd] get ...

2008-07-02 Thread Luke Tierney
On Tue, 1 Jul 2008, Duncan Murdoch wrote: On 30/06/2008 10:56 AM, Luke Tierney wrote: On Sat, 28 Jun 2008, Peter Dalgaard wrote: Gabor Grothendieck wrote: Suppose we do this: f - function(...) environment() e - f(a = 1, b = 2) ls(e, all = TRUE) [1] ... e$... ... class(e$...)

Re: [Rd] get ...

2008-07-02 Thread Gabor Grothendieck
If access is removed it would be important to provide an alternative first -- removing access and only providing an alternative some time later does not seem prudent. On Wed, Jul 2, 2008 at 10:57 AM, Luke Tierney [EMAIL PROTECTED] wrote: On Tue, 1 Jul 2008, Duncan Murdoch wrote: On 30/06/2008

Re: [Rd] get ...

2008-07-02 Thread Luke Tierney
ACCESS TO WHAT FOR CRYING OUT LOUD!! What we have now is a way for a useless internal object that is in any case subject to change to leak out. How is that useful, never mind essential? Exists works, as it should, ls works, as it should. In the language, ... arguments in functions are

Re: [Rd] get ...

2008-07-02 Thread Duncan Murdoch
On 7/2/2008 10:57 AM, Luke Tierney wrote: On Tue, 1 Jul 2008, Duncan Murdoch wrote: On 30/06/2008 10:56 AM, Luke Tierney wrote: On Sat, 28 Jun 2008, Peter Dalgaard wrote: Gabor Grothendieck wrote: Suppose we do this: f - function(...) environment() e - f(a = 1, b = 2) ls(e, all = TRUE)

Re: [Rd] get ...

2008-07-01 Thread Duncan Murdoch
On 30/06/2008 10:56 AM, Luke Tierney wrote: On Sat, 28 Jun 2008, Peter Dalgaard wrote: Gabor Grothendieck wrote: Suppose we do this: f - function(...) environment() e - f(a = 1, b = 2) ls(e, all = TRUE) [1] ... e$... ... class(e$...) [1] ... Is there any way of getting a and b

Re: [Rd] get ...

2008-06-30 Thread Luke Tierney
On Sat, 28 Jun 2008, Peter Dalgaard wrote: Gabor Grothendieck wrote: Suppose we do this: f - function(...) environment() e - f(a = 1, b = 2) ls(e, all = TRUE) [1] ... e$... ... class(e$...) [1] ... Is there any way of getting a and b given e without modifying f?

[Rd] get ...

2008-06-28 Thread Gabor Grothendieck
Suppose we do this: f - function(...) environment() e - f(a = 1, b = 2) ls(e, all = TRUE) [1] ... e$... ... class(e$...) [1] ... Is there any way of getting a and b given e without modifying f? __ R-devel@r-project.org mailing list

Re: [Rd] get ...

2008-06-28 Thread Peter Dalgaard
Gabor Grothendieck wrote: Suppose we do this: f - function(...) environment() e - f(a = 1, b = 2) ls(e, all = TRUE) [1] ... e$... ... class(e$...) [1] ... Is there any way of getting a and b given e without modifying f? evalq(list(...),e) $a [1] 1 $b [1] 2

[Rd] get number of clusters

2008-03-15 Thread Stefan Tomzeck
hello, i've a set of integers, e.g. x={1,2,3,2,3,100,101,104} I want to compute now the numbers of the clusters via gap statistic. I 've seen the commend gap. How can i use it? it doesn'work. I've loaded the the package gap and SAGx. But R does'nt recognize the command gap. Is it actually the