Re: [Rd] [R] R with MKL

2009-03-17 Thread Martyn Plummer
On Tue, 2009-03-17 at 12:12 +0900, Ei-ji Nakama wrote: > Hi > > > I have seen a lot of problems from people trying to compile R with > > MKL. So I am writing my experience in case it helps and to ask one > > question. I installed R-2.8.1.patched in Ubuntu 9.04 (gcc 4.3.3) using > > MKL 10.1.1.019.

Re: [Rd] Match .3 in a sequence

2009-03-17 Thread Wacek Kusnierczyk
Petr Savicky wrote: > On Mon, Mar 16, 2009 at 07:39:23PM -0400, Stavros Macrakis wrote: > ... > >> Let's look at the extraordinarily poor behavior I was mentioning. Consider: >> >> nums <- (.3 + 2e-16 * c(-2,-1,1,2)); nums >> [1] 0.3 0.3 0.3 0.3 >> >> Though they all print as .3 with the default

Re: [Rd] Match .3 in a sequence

2009-03-17 Thread Petr Savicky
On Tue, Mar 17, 2009 at 10:15:39AM +0100, Wacek Kusnierczyk wrote: ... > there's one more curiosity about factors, in particular, ordered factors: > > ord <- as.ordered(nums); ord > # [1] 0.300 0.3 0.3 > 0.300 > # Levels: 0.30

Re: [Rd] link in base help file fails.

2009-03-17 Thread Duncan Murdoch
On 16/03/2009 11:44 PM, Keith Satterley wrote: I run R on MS Windows. In R2.9.0dev, I type ?base to get "R help for package base" to open. I then select ".First" from the list of contents, getting a page headed: "Initialization at Start of an R Session". About half way down there is a sentence:

[Rd] exporting s3 and s4 methods

2009-03-17 Thread Thomas Lumley
If a package defined an S3 generic and an S4 generic for the same function (so as to add methods for S4 classes to the existing code), how do I set up the namespace to have them exported? With import(stats) exportMethods(bigglm) importClassesFrom(DBI) useDynLib(biglm) export(biglm) export(bi

Re: [Rd] Match .3 in a sequence

2009-03-17 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: > > > there's one more curiosity about factors, in particular, ordered factors: > > ord <- as.ordered(nums); ord > # [1] 0.300 0.3 0.3 > 0.300 > # Levels: 0.300 < 0.3 < 0.3 < 0.300 > >

Re: [Rd] link in base help file fails.

2009-03-17 Thread Duncan Murdoch
On 16/03/2009 11:44 PM, Keith Satterley wrote: I run R on MS Windows. In R2.9.0dev, I type ?base to get "R help for package base" to open. I then select ".First" from the list of contents, getting a page headed: "Initialization at Start of an R Session". About half way down there is a sentence:

[Rd] R freeze when loading dll with dyn.load

2009-03-17 Thread Morel Didier
Good morning, I am investigating dll import in R under Windows XP. Using examples I found on the internet, I started with a very simple dll, e.g. including only the basic function: void { *x2 = x*x; }sqr(doublex, double*x2) I compiled it as a dll with Eclipse and Cygwin's gcc. It works when I

Re: [Rd] R freeze when loading dll with dyn.load

2009-03-17 Thread Simon Urbanek
On Mar 17, 2009, at 8:24 , Morel Didier wrote: Good morning, I am investigating dll import in R under Windows XP. Using examples I found on the internet, I started with a very simple dll, e.g. including only the basic function: void { *x2 = x*x; }sqr(doublex, double*x2) This is not a

Re: [Rd] Match .3 in a sequence

2009-03-17 Thread Stavros Macrakis
Petr, Thank you for the detailed diagnosis of the bizarre behavior I reported, which seems to indicate several distinct problems in the underlying code: 1) Factor allows repeated levels, e.g. factor(c(1),c(1,1,1)), with no warning or error. 2) Even from distinct inputs, factor of a numeric vecto

[Rd] R does not compile any more on FreeBSD 8.0-CURRENT

2009-03-17 Thread Rainer Hurling
On a recent FreeBSD 8.0-CURRENT (i386) building R (any version) breaks with the following messages: -- [...snip...] gcc -std=gnu99 -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c wil

Re: [Rd] Match .3 in a sequence

2009-03-17 Thread Petr Savicky
On Tue, Mar 17, 2009 at 10:04:39AM -0400, Stavros Macrakis wrote: ... > 1) Factor allows repeated levels, e.g. factor(c(1),c(1,1,1)), with no > warning or error. Yes, this is a confusing behavior, since repeated levels are never meaningful. > 2) Even from distinct inputs, factor of a numeric vect

Re: [Rd] Match .3 in a sequence

2009-03-17 Thread Daniel Murphy
Is this a reasonably fast way to do an approximate match of a vector x to values in a list? match.approx <- function(x,list,tol=.0001) sapply(apply(abs(outer(list,x,"-"))wrote: > Well, first of all, seq(from=.2,to=.3) gives c(0.2), so I assume you > really mean something like seq(from=.2,to=

Re: [Rd] exporting s3 and s4 methods

2009-03-17 Thread John Chambers
You shouldn't have to export the S3 function: in the normal practice, setGeneric("biglm") or just a setMethod("biglm", ) will cause the S3 function (like any existing function) to become the default method for the S4 generic. There is only one object called "biglm". It's important though

Re: [Rd] lsfit w/ rank-deficient x

2009-03-17 Thread Vadim Ogranovich
Actually, the correct permutation is given by the inverse of qr$pivot: foo$coefficients[foo$qr$pivot] <- foo$coefficients Here foo is an object returned by lsfit, see below. -Original Message- From: Vadim Ogranovich Sent: Friday, March 13, 2009 5:25 PM To: 'r-devel@r-project.org' Subje

Re: [Rd] exporting s3 and s4 methods

2009-03-17 Thread Thomas Lumley
On Tue, 17 Mar 2009, John Chambers wrote: It's important though to use the default, one argument, call to setGeneric(). Otherwise the two functions are not consistent and can't exist in the same namespace. Thanks. Does this include restricting which arguments are used for dispatch? I have s

[Rd] Putting demo shell scripts, text files, and RScript files with a package?

2009-03-17 Thread David Rosenberg
I've written a package to assist with using R in Hadoop Streaming. The main point of the package is to help make command-line runnable RScript files. I'd like to provide a demo RScript file, a demo data file (e.g. a plaintext file, not something already processed by R) , as well as demo ba

Re: [Rd] Match .3 in a sequence

2009-03-17 Thread Duncan Murdoch
On 3/17/2009 11:26 AM, Daniel Murphy wrote: Is this a reasonably fast way to do an approximate match of a vector x to values in a list? match.approx <- function(x,list,tol=.0001) sapply(apply(abs(outer(list,x,"-")) If you are willing to assume that the list values are all multiples of 2*t

[Rd] Embedding R Engine in Cocoa

2009-03-17 Thread David Zwerdling
Hello Everyone, I'm attempting to use the R-Engine from the Mac R.app GUI project to embed R in an Objective-C application I'm writing. However, after a few days of trying, dependencies to the GUI keep tying me down. I don't need anything fancy, I'm just feeding in vectors and running regressions

[Rd] question on "row.names" attribute of dataframe when called from a compiled package

2009-03-17 Thread Whit Armstrong
Why does the following show a class attribute of "character" when using the interpreter: x <- data.frame(hat=1:10) class(rownames(x)) ## returns [1] "character" but when called from c/cpp, the rownames attribute has no class attribute, and is in fact a vector of INTSXP? > .Call("print_class_of_

Re: [Rd] question on "row.names" attribute of dataframe when called from a compiled package

2009-03-17 Thread Simon Urbanek
On Mar 17, 2009, at 16:45 , Whit Armstrong wrote: Why does the following show a class attribute of "character" when using the interpreter: x <- data.frame(hat=1:10) class(rownames(x)) ## returns [1] "character" but when called from c/cpp, the rownames attribute has no class attribute N

Re: [Rd] Embedding R Engine in Cocoa

2009-03-17 Thread Simon Urbanek
On Mar 17, 2009, at 15:51 , David Zwerdling wrote: Hello Everyone, I'm attempting to use the R-Engine from the Mac R.app GUI project to embed R in an Objective-C application I'm writing. However, after a few days of trying, dependencies to the GUI keep tying me down. I don't need anythin

Re: [Rd] exporting s3 and s4 methods

2009-03-17 Thread John Chambers
Thomas Lumley wrote: On Tue, 17 Mar 2009, John Chambers wrote: It's important though to use the default, one argument, call to setGeneric(). Otherwise the two functions are not consistent and can't exist in the same namespace. Thanks. Does this include restricting which arguments are used fo