[Rd] reshape scaling with large numbers of times/rows

2006-08-23 Thread Mitch Skinner
Hello, I'm mailing r-devel because I think the performance problem I'm having is best solved by re-writing reshape() in C. I've been reading the "writing R extensions" documentation and I have some questions about they best way to write the C bits, but first let me describe my problem: I'm tryin

[Rd] call to pt: Warning message: full precision was not achieved in 'pnt' (PR#9171)

2006-08-23 Thread FromeEL
I have followed all instruction in R FAQ Section 9.2 This looks like a bug to me "C:\Program Files\R\R-2.3.1\bin\Rgui.exe" --sdi > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor

Re: [Rd] S3 fonctions for object of S4 class

2006-08-23 Thread Parlamis Franklin
Franck: I suspect you'll have to include the exact wording of the relevant setGeneric and setMethod calls (as well as any other functions called in your method) to get an answer to your question. I just did: > setGeneric("start", function(x, ...) standardGeneric("start")) [1] "start" > set

[Rd] S3 fonctions for object of S4 class

2006-08-23 Thread Franck Arnaud
Hello ! there's a S3 method called start (and end too) to be used with objects of class ts (package stats). I am writing a S4 class for which I would like to use this function start, so that start with a ts calls the former method and start with my S4 class (called MA) calls the function I want. Fo

Re: [Rd] UPDATE: Fwd: Memory...

2006-08-23 Thread Hin-Tak Leung
I think it needs to be strlen()+1, for the terminating null, or you'll just be pray for your luck that your compiler actually null-pad allocations to the nearest 4-byte or whatever and so your program doesn't crash as it should later when you try to read argV elsewhere. As for the other question a

[Rd] UPDATE: Fwd: Memory...

2006-08-23 Thread Sender
UPDATE: Okay I've narrowed the problem down. Within my C routine I use the getopt() method from . For some reason when I recall this routine via my .Call, getopt() hasn't "refreshed" that is it still points to the end of my parsed command line arguments. Is R keeping this function alive in memo

Re: [Rd] Strict seq: a recommendation

2006-08-23 Thread Bill Dunlap
On Wed, 23 Aug 2006, Tony Plate wrote: > The way I avoid this problem is to use seq(len=n) instead of 1:n. > Of course, the syntax can get inconvenient for starting values other > than 1 or 0, but I haven't found that to be much of a problem. > > Using the idiom 1:n in programming (as opposed to i

Re: [Rd] [R] Successive subsets from a vector?

2006-08-23 Thread Gabor Grothendieck
On 8/23/06, John Chambers <[EMAIL PROTECTED]> wrote: > A different discussion is the desire to pass object references in R. > There are in fact objects that currently act as references, notably > environments. If one wants to, a general reference-semantic set of > capabilities can be added to R,

Re: [Rd] Strict seq: a recommendation

2006-08-23 Thread Brahm, David
I use: for (m in beg %:% end) {...} where "%:%" <- function(a, b) if (b >= a) a:b -- David Brahm ([EMAIL PROTECTED]) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dominick Samperi Sent: Wednesday, August 23, 2006 11:13 AM To: r-devel@r-project.or

Re: [Rd] Strict seq: a recommendation

2006-08-23 Thread Tony Plate
The way I avoid this problem is to use seq(len=n) instead of 1:n. Of course, the syntax can get inconvenient for starting values other than 1 or 0, but I haven't found that to be much of a problem. Using the idiom 1:n in programming (as opposed to interactive use) results in errors commonly enou

Re: [Rd] [R] Successive subsets from a vector?

2006-08-23 Thread John Chambers
hadley wickham wrote: >>> Providing the ability to write assignment functions that don't duplicate >>> is a more urgent problem. >>> >> You mean, for end-users? It can be done via primitives. >> > > Isn't this sort of a run-time optimisation? I thought R generally > followed the funct

Re: [Rd] Strict seq: a recommendation

2006-08-23 Thread Gabor Grothendieck
This is a longstanding problem when programing with seq. In the common case that one wants 1,...,n such that if n is zero a zero length answer is wanted, one can write seq(length = n) instead of 1:n. However, the general case is still a problem, as you point out. On 8/23/06, Dominick Samperi <[EM

Re: [Rd] Strict seq: a recommendation

2006-08-23 Thread Prof Brian Ripley
On Wed, 23 Aug 2006, Thomas Lumley wrote: > On Wed, 23 Aug 2006, Dominick Samperi wrote: > > > In for loops of the form: > > for(m in seq(beg,end)) > > ... > > > > when beg > end, the default behavior is > > to decrement, and the action described > > by ... is executed at least once. > > > > On t

[Rd] Memory...

2006-08-23 Thread Sender
Hello: I have a general question about memory allocation. I'm having a problem with an R function -- call it myRfunction -- that calls a C routine using .Call. For some reason it works the first time I call it, but for every subsequent time it doesn't. I'm thinking this has to be a memory alloc

Re: [Rd] Strict seq: a recommendation

2006-08-23 Thread Dominick Samperi
I should point out that this recommendation was not designed just to accommodate C/C++, it was motivated by problems with R code of the form: for(m in seq(beg,end)) val <- x[m] Take beg=1, end=0, for example. This results in val <- x[0] and R issues no error about the subscript being out of bound

Re: [Rd] Strict seq: a recommendation

2006-08-23 Thread Thomas Lumley
On Wed, 23 Aug 2006, Dominick Samperi wrote: > In for loops of the form: > for(m in seq(beg,end)) > ... > > when beg > end, the default behavior is > to decrement, and the action described > by ... is executed at least once. > > On the other hand, if you view this > construction as a translation o

[Rd] Strict seq: a recommendation

2006-08-23 Thread Dominick Samperi
In for loops of the form: for(m in seq(beg,end)) ... when beg > end, the default behavior is to decrement, and the action described by ... is executed at least once. On the other hand, if you view this construction as a translation of the C code: for(m = beg; m < end; m++) ... then the semantics

Re: [Rd] [R] big numbers

2006-08-23 Thread Hin-Tak Leung
Robin Hankin wrote: > [[shifting to R-devel]] > > Hi Roger > > yes, I'm aware of gmp, but although it does handle big > numbers, it uses exact integer arithmetic, which would be > too slow for me. > > My example of 10^1 *(1+pi) ~= 4.14259*10^1 > would require gmp to process 1 digits,

Re: [Rd] [R] Successive subsets from a vector?

2006-08-23 Thread hadley wickham
> > Providing the ability to write assignment functions that don't duplicate > > is a more urgent problem. > > You mean, for end-users? It can be done via primitives. Isn't this sort of a run-time optimisation? I thought R generally followed the functional programming model of immutable objects,