Re: [Rd] IDE for R C++ package writing ?

2007-02-26 Thread mel
First, great thanks to all for all the answers. I confess i was a bit scared about (re)learning a possible tomorrow obsolete tool. I'm however quite astonished nobody proposes another tool. Do 100% R package developers use emacs ? Anyway, given the answers, it seems i'll go on emacs or xemacs.

Re: [Rd] R/C++/memory leaks

2007-02-26 Thread Hin-Tak Leung
Read the help page of gc(). You need to run it with reset=TRUE for the usage to drop back to original. i.e. gc(reset=TRUE). gc() on its own doesn't quite do what you think it would do. Ernest Turro wrote: > Dear all, > > I have wrapped a C++ function in an R package. I allocate/deallocate > mem

[Rd] typo in nls.Rd

2007-02-26 Thread Katharine Mullen
in R version 2.5.0 Under development (unstable) (2007-02-25 r40804), the `formula' entry in the `arguments' section of nls.Rd (L25-26) reads \item{formula}{a nonlinear model \link{formula} including variables and parameters. Will be coerced to a formula is necessary.} `is' should be `if'.

Re: [Rd] R/C++/memory leaks

2007-02-26 Thread Ernest Turro
On 26 Feb 2007, at 10:51, Hin-Tak Leung wrote: > Ernest Turro wrote: >> Dear all, >> I have wrapped a C++ function in an R package. I allocate/ >> deallocate memory using C++ 'new' and 'delete'. In order to allow >> user interrupts without memory leaks I've moved all the delete >> statement

Re: [Rd] IDE for R C++ package writing ?

2007-02-26 Thread elw
> First, great thanks to all for all the answers. I confess i was a bit > scared about (re)learning a possible tomorrow obsolete tool. > > I'm however quite astonished nobody proposes another tool. Do 100% R > package developers use emacs ? Plenty of folks don't use an IDE at all. Copy/pastin

Re: [Rd] IDE for R C++ package writing ?

2007-02-26 Thread Ramon Diaz-Uriarte
On Monday 26 February 2007 16:51, [EMAIL PROTECTED] wrote: > > First, great thanks to all for all the answers. I confess i was a bit > > scared about (re)learning a possible tomorrow obsolete tool. > > > > I'm however quite astonished nobody proposes another tool. Do 100% R > > package developers u

[Rd] Is there any package on CRAN that uses Fortran-90/95

2007-02-26 Thread Gorjanc Gregor
Hi! Is there any package on CRAN that uses Fortran-90/95? I would like to study it. Thanks, Gregor __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] IDE for R C++ package writing ?

2007-02-26 Thread elw
Ya, copy/paste from .Rhistory is pretty common. Especially among newbies and oldsters who dislike IDEs. :) [I got burned by Borland, way back when, and basically can't stand "wizards" and the like now...] Looks like someone wrote a "send-to-R" plugin for vim last year: http://www.vim.org

Re: [Rd] R/C++/memory leaks

2007-02-26 Thread Ernest Turro
Thanks for your comments Ross. A couple more comments/queries below: On 26 Feb 2007, at 06:43, Ross Boylan wrote: > [details snipped] > > The use of the R api can be confined to a wrapper function. But I can > think of no reason that a change to the alternate approach I outlined > would solve th

Re: [Rd] Depending on many packages: another best practice question

2007-02-26 Thread hadley wickham
> You can use > > if(require(myPackage)) { ... } Yes, but the problem with this is that I now have the fact that this function requires that package stated in two places - in the body of the function, and in the examples - adding redundancy which makes maintenance harder. I guess what I really wa

Re: [Rd] R/C++/memory leaks

2007-02-26 Thread Simon Urbanek
Ernest, On Feb 25, 2007, at 12:37 PM, Ernest Turro wrote: > I have wrapped a C++ function in an R package. I allocate/ > deallocate memory using C++ 'new' and 'delete'. In order to allow > user interrupts without memory leaks How do you allow for user interrupts? R doesn't allow interrupts

Re: [Rd] R/C++/memory leaks

2007-02-26 Thread Ernest Turro
Hi Simon, On 26 Feb 2007, at 16:58, Simon Urbanek wrote: > Ernest, > > On Feb 25, 2007, at 12:37 PM, Ernest Turro wrote: > >> I have wrapped a C++ function in an R package. I allocate/ >> deallocate memory using C++ 'new' and 'delete'. In order to allow >> user interrupts without memory leaks

Re: [Rd] R/C++/memory leaks

2007-02-26 Thread Thomas Lumley
On Mon, 26 Feb 2007, Hin-Tak Leung wrote: > Read the help page of gc(). You need to run it with reset=TRUE for > the usage to drop back to original. i.e. gc(reset=TRUE). gc() on its > own doesn't quite do what you think it would do. This is almost completely incorrect (apart from the advice to re

Re: [Rd] R/C++/memory leaks

2007-02-26 Thread Ross Boylan
On Mon, 2007-02-26 at 16:08 +, Ernest Turro wrote: > Thanks for your comments Ross. A couple more comments/queries below: > > On 26 Feb 2007, at 06:43, Ross Boylan wrote: > > > [details snipped] > > > > The use of the R api can be confined to a wrapper function. But I can > > think of no rea

[Rd] Checking for user interrupt in a .C() call without without triggering a non-local exit.

2007-02-26 Thread Pavel N. Krivitsky
Hi, An R package on which I am working makes a series of very computationally-intensive and complex .C() calls, that I would like to make interruptible. However, calling R_CheckUserInterrupt() causes a non-local exit, so the memory allocated by malloc() is never freed. The way the code is structur