[Rd] S4 method execution time

2010-04-30 Thread Daniel Murphy
Hello: I have written some an elementary S4 classes around a matrix to strengthen control of some key attributes. When I run a fairly elementary function (f) on the matrix outside the class it runs instantaneously (elapsed system.time = 0) but when I setMethod f on myClass -- returning an

Re: [Rd] Memory allocation in C/C++ vs R?

2010-04-30 Thread Prof Brian Ripley
On Fri, 30 Apr 2010, Dominick Samperi wrote: The R docs say that there are two methods that the C programmer can allocate memory, one where R automatically frees the memory on return from .C/.Call, and the other where the user takes responsibility for freeing the storage. Both methods involve

Re: [Rd] S4 method execution time

2010-04-30 Thread Prof Brian Ripley
On Fri, 30 Apr 2010, Daniel Murphy wrote: Hello: I have written some an elementary S4 classes around a matrix to strengthen control of some key attributes. When I run a fairly elementary function (f) on the matrix outside the class it runs instantaneously (elapsed system.time = 0) but when I

[Rd] Likely disruption to R-devel builds on Windows

2010-04-30 Thread Prof Brian Ripley
We are planning to phase in some major changes to the R build process on Windows shortly, so expect problems and temporary unavailability of binary builds of R and of packages, and if you are building from sources, check out the latest version of the R-admin manual (in the sources) for the

Re: [Rd] R CMD check Error after R CMD build for R-2.11.0

2010-04-30 Thread Hamid Khalili
I'm really sorry that I had to disturb you (for nothing) because everything looks fine now ( why ??). After I build again the package with search() in the Rsq.2.array examples, I didn't get any Error. The only things that I changed it's the directory where is build the package. The package

Re: [Rd] Memory allocation in C/C++ vs R?

2010-04-30 Thread Simon Urbanek
Brian's answer was pretty exhaustive - just one more note that is indirectly related to memory management: C++ exception handling does interfere with R's error handling (and vice versa) so in general STL is very dangerous and best avoided in R. In addition, remember that regular local object

[Rd] Most recent R manuals [Was: Likely disruption to R-devel builds on Windows]

2010-04-30 Thread Simon Urbanek
On Apr 30, 2010, at 4:20 AM, Prof Brian Ripley wrote: We are planning to phase in some major changes to the R build process on Windows shortly, so expect problems and temporary unavailability of binary builds of R and of packages, and if you are building from sources, check out the latest

Re: [Rd] Most recent R manuals [Was: Likely disruption to R-devel builds on Windows]

2010-04-30 Thread Gabor Grothendieck
Some easy way to find out what has changed would be desirable here. On Fri, Apr 30, 2010 at 9:03 AM, Simon Urbanek simon.urba...@r-project.org wrote: On Apr 30, 2010, at 4:20 AM, Prof Brian Ripley wrote: We are planning to phase in some major changes to the R build process on Windows

Re: [Rd] Most recent R manuals [Was: Likely disruption to R-devel builds on Windows]

2010-04-30 Thread hadley wickham
Maybe Duncan could apply the same script that's being used for RNEWS to the manuals? An RSS feed of changes to the manuals would be really useful. Hadley On Fri, Apr 30, 2010 at 8:16 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: Some easy way to find out what has changed would be

Re: [Rd] Most recent R manuals [Was: Likely disruption to R-devel builds on Windows]

2010-04-30 Thread Duncan Murdoch
On 30/04/2010 10:22 AM, hadley wickham wrote: Maybe Duncan could apply the same script that's being used for RNEWS to the manuals? An RSS feed of changes to the manuals would be really useful. My script is very NEWS specific. The manuals would be harder. You could get the diffs from svn

Re: [Rd] Most recent R manuals [Was: Likely disruption to R-devel builds on Windows]

2010-04-30 Thread Gabor Grothendieck
On Fri, Apr 30, 2010 at 10:39 AM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 30/04/2010 10:22 AM, hadley wickham wrote: Maybe Duncan could apply the same script that's being used for RNEWS to the manuals?  An RSS feed of changes to the manuals would be really useful. My script is very

Re: [Rd] Most recent R manuals [Was: Likely disruption to R-devel builds on Windows]

2010-04-30 Thread hadley wickham
My script is very NEWS specific.  The manuals would be harder.  You could get the diffs from svn pretty easily, but displaying them would be trickier:  do you display the diffs in the .texi source, or convert to HTML and display the diffs there, or what?  How much context around them?  Not

Re: [Rd] Most recent R manuals [Was: Likely disruption to R-devel builds on Windows]

2010-04-30 Thread Duncan Murdoch
On 30/04/2010 10:48 AM, Gabor Grothendieck wrote: On Fri, Apr 30, 2010 at 10:39 AM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 30/04/2010 10:22 AM, hadley wickham wrote: Maybe Duncan could apply the same script that's being used for RNEWS to the manuals? An RSS feed of changes to the

[Rd] Request - adding recycled lwd parameter to polygon

2010-04-30 Thread Tal Galili
Hello dear members of R-devel mailing list and Kevin Buhr (the author of the polygon function), After some private e-mails, I was informed this is the place to post this feature request. I hope I am correct. I would like to use a command like this: plot(c(1,8), 1:2, type=n) polygon(1:7,

[Rd] RInside child threads

2010-04-30 Thread Jaiganesh Balasubramanian
Hi Folks, I am creating a multi-threaded C++ application that initializes RInside in one of the child thread. I would also like to access support interfaces like Rcpp::Environment in the remaining child threads, so that I could access any R function associated with the environment initialized.

Re: [Rd] Memory allocation in C/C++ vs R?

2010-04-30 Thread Dominick Samperi
Simon, Just to be sure that I understand, are you suggesting that the R-safe way to do things is to not use STL, and to not use C++ memory management and exception handling? How can you leave a function in an irregular way without triggering a seg fault or something like that, in which case there

Re: [Rd] Memory allocation in C/C++ vs R?

2010-04-30 Thread Simon Urbanek
Dominick, On Apr 30, 2010, at 1:40 PM, Dominick Samperi wrote: Just to be sure that I understand, are you suggesting that the R-safe way to do things is to not use STL, and to not use C++ memory management and exception handling? How can you leave a function in an irregular way without

Re: [Rd] Most recent R manuals [Was: Likely disruption to R-devel builds on Windows]

2010-04-30 Thread Gabor Grothendieck
On Fri, Apr 30, 2010 at 11:01 AM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 30/04/2010 10:48 AM, Gabor Grothendieck wrote: On Fri, Apr 30, 2010 at 10:39 AM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 30/04/2010 10:22 AM, hadley wickham wrote: Maybe Duncan could apply the same

Re: [Rd] Most recent R manuals [Was: Likely disruption to R-devel builds on Windows]

2010-04-30 Thread Duncan Murdoch
On 30/04/2010 2:11 PM, Gabor Grothendieck wrote: On Fri, Apr 30, 2010 at 11:01 AM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 30/04/2010 10:48 AM, Gabor Grothendieck wrote: On Fri, Apr 30, 2010 at 10:39 AM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 30/04/2010 10:22 AM, hadley

Re: [Rd] Memory allocation in C/C++ vs R?

2010-04-30 Thread Dominick Samperi
Thanks for the clarification Simon, I think it is safe (R-safe?) to say that if there are no exceptions or errors on either side, then it is highly likely that everything is fine. When there are errors or exceptions, it is probably NOT safe to try to recover. Better to terminate the R session,

Re: [Rd] Memory allocation in C/C++ vs R?

2010-04-30 Thread Simon Urbanek
Dominick, On Apr 30, 2010, at 2:51 PM, Dominick Samperi wrote: Thanks for the clarification Simon, I think it is safe (R-safe?) to say that if there are no exceptions or errors on either side, then it is highly likely that everything is fine. I think so - at least on the exceptions

Re: [Rd] Memory allocation in C/C++ vs R?

2010-04-30 Thread Dominick Samperi
Indeed. As I said, using heap objects (explicit initialization) does solve that issue, but you have to be again wary of other libraries which may still use static initializers. I just did a little test and found, in the case of gcc/g++, that a main C main program linked with a C++ library

[Rd] as.character() crashes R 2.11 on Win2008 x64 and Win7 64

2010-04-30 Thread Nicholas Hirschey
Dear List, I have a Date vector, and converting to character causes Rnbsp;2.11 tonbsp;crash on one machine running Win2008 x64 and another running Win7 x64. The code runs fine on R 2.10. For example, x lt;-nbsp;as.Date(rep(1:15000, 10), '1970-01-01') y lt;- as.character(x) At this point,

[Rd] na.action(lmObject) - NULL instead of lmObject$na.action

2010-04-30 Thread William Dunlap
I think the following three calls to na.action() should return the same thing, but the last returns NULL. d - data.frame(x=c(1,2,NA,NA,5), y=log(1:5), row.names=LETTERS[1:5]) na.action(na.exclude(d)) C D 3 4 attr(,class) [1] exclude na.action(model.frame(y~x, data=d,

Re: [Rd] as.character() crashes R 2.11 on Win2008 x64 and Win7 64

2010-04-30 Thread Duncan Murdoch
On 30/04/2010 6:23 PM, Nicholas Hirschey wrote: Dear List, I have a Date vector, and converting to character causes Rnbsp;2.11 tonbsp;crash on one machine running Win2008 x64 and another running Win7 x64. The code runs fine on R 2.10. For example, x lt;-nbsp;as.Date(rep(1:15000, 10),