Re: [Rd] Create an environment and assign objects to it in one go?

2011-03-09 Thread peter dalgaard
On Mar 10, 2011, at 08:44 , Henrik Bengtsson wrote: > Hi, > > I've just created: > > newEnvEval <- function(..., hash=FALSE, parent=parent.frame(), size=29L) { > envir <- new.env(hash=hash, parent=parent, size=size); > evalq(..., envir=envir); > envir; > } # newEnvEval() > > so that I can c

[Rd] Create an environment and assign objects to it in one go?

2011-03-09 Thread Henrik Bengtsson
Hi, I've just created: newEnvEval <- function(..., hash=FALSE, parent=parent.frame(), size=29L) { envir <- new.env(hash=hash, parent=parent, size=size); evalq(..., envir=envir); envir; } # newEnvEval() so that I can create an environment and assign objects to it in one go, e.g. env <- new

Re: [Rd] avoid copying big object passed into optimize()

2011-03-09 Thread Matt Shotwell
On Wed, 2011-03-09 at 17:15 -0900, Zepu Zhang wrote: > Hello list, > > I have the following scenario: > > f1 <- function(a) > { > # doing things; may need 'a', but does not change 'a'. > > g <- function(x) > { > sum(x + a)# Say. Use 'a'; does not change 'a'. Th

[Rd] avoid copying big object passed into optimize()

2011-03-09 Thread Zepu Zhang
Hello list, I have the following scenario: f1 <- function(a) { # doing things; may need 'a', but does not change 'a'. g <- function(x) { sum(x + a)# Say. Use 'a'; does not change 'a'. } optimize(f = g, lower = 0, upper = 1) } f2 <- function() {

[Rd] R and ATLAS and distributing across boxes

2011-03-09 Thread Adam D. I. Kramer
Hi, If I have a cluster of heterogenous machines, each with their own self-optimized ATLAS, do I need to compile R on each machine to tell it to take advantage of the local ATLAS? Or is it sufficient to compile R once with the appropriate --with-blas and --with-lapack flags, and then trus

[Rd] unique.matrix issue [Was: Anomaly with unique and match]

2011-03-09 Thread Simon Urbanek
match() is a red herring here -- it is really a very specific thing that has to do with the fact that you're running unique() on a matrix. Also it's much easier to reproduce: > x=c(1,1+0.2e-15) > x [1] 1 1 > sprintf("%a",x) [1] "0x1p+0" "0x1.1p+0" > unique(x) [1] 1 1 >

Re: [Rd] Anomaly with unique and match

2011-03-09 Thread Petr Savicky
On Wed, Mar 09, 2011 at 08:48:10AM -0600, Terry Therneau wrote: > I stumbled onto this working on an update to coxph. The last 6 lines > below are the question, the rest create a test data set. > > tmt585% R > R version 2.12.2 (2011-02-25) > Copyright (C) 2011 The R Foundation for Statistical Com

[Rd] Anomaly with unique and match

2011-03-09 Thread Terry Therneau
I stumbled onto this working on an update to coxph. The last 6 lines below are the question, the rest create a test data set. tmt585% R R version 2.12.2 (2011-02-25) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-unknown-linux-gnu (64-bit) # Lin

Re: [Rd] How to disable R's crash prompt

2011-03-09 Thread Wayne.Zhang
I never said I wasn't going to fix the bug, and believe me big banks do want their apps to be of high quality, but until the bugs are fixed I want my app to die instead of becoming a zombie. But thanks for your opinion and all others that offered help along the way. Wayne -Original Messa

Re: [Rd] How to disable R's crash prompt

2011-03-09 Thread Barry Rowlingson
On Tue, Mar 8, 2011 at 10:41 PM, wrote: > That did the trick.  Thank you soo much Simon! But really you *should* fix the segfault. Either you know why it happens, in which case you should spot it before it happens and do something sensible, or you don't know why it happens, in which case it