[Rd] time_t handling in R

2006-09-27 Thread Tom McCallum
Hello all, I am converting some C code into a package for R and wondered what the proper way of handling time_t types from C in R was. time_t is a typedef for long, but R seems to only deal in Integers or Reals, so what is the proper way of handling time in an R to C conversion ( or visa ve

Re: [Rd] Warning on backslash sequences (was sprintf behavior)

2006-09-27 Thread Prof Brian Ripley
On Tue, 26 Sep 2006, Bill Dunlap wrote: > On Mon, 25 Sep 2006 [EMAIL PROTECTED] wrote: > >> On Mon, 25 Sep 2006, [EMAIL PROTECTED] wrote: >> ... >>> sprintf("\p") doesn't show the backslash, this occurs with all strings that >>> start with certain letters. There is however no explanation to this

[Rd] colnames is slow for data.frames with implicit row.names

2006-09-27 Thread Martin Morgan
colnames on a data.frame with implicit row.names > df <- data.frame(x=1:600) is slow > system.time(colnames(df)) [1] 21.655 0.327 21.987 0.000 0.000 > system.time(names(df)) [1] 0 0 0 0 0 because colnames calls dimnames calls row.names.data.frame calls as.character on the implicit row.na

Re: [Rd] colnames is slow for data.frames with implicit row.names

2006-09-27 Thread Prof Brian Ripley
On Wed, 27 Sep 2006, Martin Morgan wrote: > colnames on a data.frame with implicit row.names > >> df <- data.frame(x=1:600) > > is slow > >> system.time(colnames(df)) > [1] 21.655 0.327 21.987 0.000 0.000 >> system.time(names(df)) > [1] 0 0 0 0 0 > > because colnames calls dimnames calls ro

Re: [Rd] colnames is slow for data.frames with implicit row.names

2006-09-27 Thread Martin Morgan
Yes, obviously, with hindsight. In lieu of code change, the colnames documentation could indicate the restricted sense of 'equivalent'. For a data frame, 'rownames' and 'colnames' are equivalent to 'row.names' and 'names' respectively. It might help to add 'names' to See Also of ?data.fr

Re: [Rd] time_t handling in R

2006-09-27 Thread Thomas Lumley
On Wed, 27 Sep 2006, Tom McCallum wrote: > Hello all, > > I am converting some C code into a package for R and wondered what the > proper way of handling time_t types from C in R was. time_t is a typedef > for long, but R seems to only deal in Integers or Reals, so what is the > proper way of han

Re: [Rd] S4 accessors

2006-09-27 Thread John Chambers
There is a point that needs to be remembered in discussions of accessor functions (and more generally). We're working with a class/method mechanism in a _functional_ language. Simple analogies made from class-based languages such as Java are not always good guides. In the example below, "a fu

[Rd] Building R-2.3.1 for Windows with ATLAS

2006-09-27 Thread Giuseppe Antonaci
Ok, moved to R-devel. I tried to build R-2.3.1. Since I intent to distribute this tuned R to all other who have a computer like mine here at work I thought it was best to stay with the latest stable release. About your suggestion, I could'n find xerblas.o file. And I don't know how to edit libf77

Re: [Rd] Building R-2.3.1 for Windows with ATLAS

2006-09-27 Thread Prof Brian Ripley
On Wed, 27 Sep 2006, Giuseppe Antonaci wrote: > Ok, moved to R-devel. > > I tried to build R-2.3.1. Since I intent to distribute this tuned R to > all other who have a computer like mine here at work I thought it was > best to stay with the latest stable release. Which is 2.4.0 RC. > About your

Re: [Rd] Warning on backslash sequences (was sprintf behavior)

2006-09-27 Thread Bill Dunlap
> > Splus's parser emits a warning when it sees a backslash > > outside of the recognized backslash sequence. E.g., > > > > > nchar("\Backslashed?") > > [1] 12 > > Warning messages: > >The initial backslash is ignored in \B -- not a recognized escape > > sequence. > > Use \\ to ma

Re: [Rd] S4 accessors

2006-09-27 Thread Seth Falcon
John Chambers <[EMAIL PROTECTED]> writes: > There is a point that needs to be remembered in discussions of > accessor functions (and more generally). > > We're working with a class/method mechanism in a _functional_ > language. Simple analogies made from class-based languages such as > Java are n

Re: [Rd] S4 accessors

2006-09-27 Thread John Chambers
Seth Falcon wrote: > John Chambers <[EMAIL PROTECTED]> writes: > > >> There is a point that needs to be remembered in discussions of >> accessor functions (and more generally). >> >> We're working with a class/method mechanism in a _functional_ >> language. Simple analogies made from class-base

[Rd] S3 methods for cbind/rbind

2006-09-27 Thread Vincent Goulet
I created a type of object similar to a data frame. In some circumstances, It needs special methods for "[" and "[<-" and rbind() (but not cbind()). Then I found this in the cbind()/rbind() man page: The method dispatching is _not_ done via 'UseMethod()', but by C-internal dispatching.

Re: [Rd] S3 methods for cbind/rbind

2006-09-27 Thread Vincent Goulet
Hum. Then, I need to be more accurate. My object is of class c("bar", "data.frame"). So, by virtue of ... The dispatch algorithm is described in the source file ('.../src/main/bind.c') as 1. For each argument we get the list of possible class memberships from the cl

Re: [Rd] S3 methods for cbind/rbind

2006-09-27 Thread Gabor Grothendieck
Actually you can add your own method. See library(zoo) rbind.zoo for an example. On 9/27/06, Vincent Goulet <[EMAIL PROTECTED]> wrote: > I created a type of object similar to a data frame. In some circumstances, It > needs special methods for "[" and "[<-" and rbind() (but not cbind()). Then I

Re: [Rd] S3 methods for cbind/rbind

2006-09-27 Thread Gabor Grothendieck
Maybe you could use rbind2, which has an S4 generic in the methods package, instead? # BOD is a data frame built into R foo <- structure(BOD, class = c("bar", "data.frame")) setOldClass("bar") setMethod("rbind2", signature(x = "bar", y = "bar"), function(x, y) { cat("Hell

Re: [Rd] S4 accessors

2006-09-27 Thread Henrik Bengtsson
On 9/27/06, John Chambers <[EMAIL PROTECTED]> wrote: > There is a point that needs to be remembered in discussions of accessor > functions (and more generally). > > We're working with a class/method mechanism in a _functional_ language. > Simple analogies made from class-based languages such as Jav

Re: [Rd] S4 accessors

2006-09-27 Thread Ross Boylan
I'm trying to understand what the underlying issues are here--with the immediate goal of how that affects my design and documentation decisions. On Wed, Sep 27, 2006 at 02:08:34PM -0400, John Chambers wrote: > Seth Falcon wrote: > > John Chambers <[EMAIL PROTECTED]> writes: > > > > > >> There i

[Rd] potential setClass bug (with user-defined environment)

2006-09-27 Thread Parlamis Franklin
the following returns an error in an 'exists' call on my machine MyEnv <- new.env() setClass("Numeric", "numeric", where=MyEnv) franklin parlamis > version _ platform powerpc-apple-darwin8.7.0 arch powerpc os darwin8.7.0 system powerpc, darwin

[Rd] 'St9bad_alloc' (PR#9261)

2006-09-27 Thread watplatt
Full_Name: Daniel E. Platt Version: 2.3.1 OS: Win/XP - Cygwin Submission from: (NULL) (68.198.10.240) Error report: terminate called after throwing an instance of 'St9bad_alloc' what(): St9bad_alloc Aborted (core dumped) No indication of what the calling routine was, where the request came

Re: [Rd] potential setClass bug (with user-defined environment)

2006-09-27 Thread Martin Morgan
A previous report (no resolution) here: https://stat.ethz.ch/pipermail/r-devel/2006-August/038896.html I guess that's two of us with at least a passing encounter with this! Martin Parlamis Franklin <[EMAIL PROTECTED]> writes: > the following returns an error in an 'exists' call on my machine >

[Rd] eval(SEXP fn,SEXP rho) in C++ code

2006-09-27 Thread Patricia Bautista
Hi r-devel, I am working on a R extension. I am writing the function in C++, and in my function it is required a R function object from the user. This R function object will be evaluated thousand of times in my C++ code. I generated the shared library and I loaded it on R. I did several experimen

Re: [Rd] eval(SEXP fn,SEXP rho) in C++ code

2006-09-27 Thread Seth Falcon
Patricia Bautista <[EMAIL PROTECTED]> writes: > Hi r-devel, > > I am working on a R extension. I am writing the > function in C++, and in my function it is required a R > function object from the user. This R function object > will be evaluated thousand of times in my C++ code. I > generated the

Re: [Rd] (PR#9248) Incomplete loading of files into Windows script

2006-09-27 Thread ripley
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --27464147-762791266-1159424200=:16565 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT This does look

Re: [Rd] 'St9bad_alloc' (PR#9261)

2006-09-27 Thread ripley
This is not how Windows reports errors, and there are no reproduction instructions. Please do study the section on BUGS in the FAQ. If this was a report on a Windows build of R, see the rw-FAQ on how to get useful debugging information. This look suspiciously like a report from C++ code. Ther