[Rd] Package that does not work until I re write the exactly the same code

2009-09-09 Thread Christophe Genolini
Hi the list, I am writing a package in S4 and I do not manage to understand a bug. The "R CMD check" and the "R CMD build" both work. Here is links to the package (not on CRAN yet for the raison that I explain bellow): http://christophe.genolini.free.fr/aTelecharger/kml_0.5.zip http://christop

[Rd] Finding the environment of a promise

2009-09-09 Thread Hadley Wickham
Hi all, Is it possible to determine the environment in which a promise will be evaluated? e.g. f <- function(code) { force(code) } f({ a <- 1 b <- 2 }) Is there any way to tell from within f that a and b will be created in the global environment? Thanks, Hadley -- http://had.co.nz/ ___

Re: [Rd] Finding the environment of a promise

2009-09-09 Thread Henrique Dallazuanna
If I understand your question, you can get the environment with sys.frame: f <- function(code){ print(sys.frame()) force(code) } f({ a <- 1 b <- 2 }) On Wed, Sep 9, 2009 at 10:30 AM, Hadley Wickham wrote: > Hi all, > > Is it possible to determine the environment in which a promise wi

[Rd] Debugging R core

2009-09-09 Thread Yuri D'Elia
Hi everyone. I'm working on R sources themselves (look into past messages if interested), and need to debug/benchmark R itself. To check R functionality, I'm running the test-suite with 'make check-devel', but it seems to overwrite the "reference output" at each invocation. I want to compare the o

Re: [Rd] Finding the environment of a promise

2009-09-09 Thread Duncan Murdoch
On 9/9/2009 9:30 AM, Hadley Wickham wrote: Hi all, Is it possible to determine the environment in which a promise will be evaluated? e.g. f <- function(code) { force(code) } f({ a <- 1 b <- 2 }) Is there any way to tell from within f that a and b will be created in the global environment?

[Rd] Monkey patching +.POSIXt

2009-09-09 Thread Hadley Wickham
Hi all, This summer I've been working with a grad student to bring more of the date time classes from JODA (http://joda-time.sourceforge.net/) into R. To make these work seamlessly with existing date time objects, we need to patch +.POSIXt. (The ruby community uses the term monkey-patching for thi

Re: [Rd] Finding the environment of a promise

2009-09-09 Thread Hadley Wickham
> I don't think so in R code, but C code to do it would be possible.  It needs > to be in C code to avoid forcing the promise. Thanks Duncan - I thought that might be the case. > I think we'd be reluctant to make an R function available to do this, > because it requires non-standard evaluation, a

Re: [Rd] Finding the environment of a promise

2009-09-09 Thread Simon Urbanek
On Sep 9, 2009, at 9:40 , Henrique Dallazuanna wrote: If I understand your question, you can get the environment with sys.frame: f <- function(code){ print(sys.frame()) ^-- this will always return R_GlobalEnv (see ?sys.frame - which = 0 by default) regardless of the function and promi

Re: [Rd] Finding the environment of a promise

2009-09-09 Thread Henrique Dallazuanna
You are right, in the first time that I read the post, I understand incorrectly the question. On Wed, Sep 9, 2009 at 12:09 PM, Simon Urbanek wrote: > > On Sep 9, 2009, at 9:40 , Henrique Dallazuanna wrote: > > If I understand your question, you can get the environment with sys.frame: >> >> f

Re: [Rd] Finding the environment of a promise

2009-09-09 Thread Duncan Murdoch
On 9/9/2009 10:53 AM, Hadley Wickham wrote: I don't think so in R code, but C code to do it would be possible. It needs to be in C code to avoid forcing the promise. Thanks Duncan - I thought that might be the case. I think we'd be reluctant to make an R function available to do this, becaus

Re: [Rd] Dependencies of packages' CHECK....

2009-09-09 Thread Allen S. Rout
Uwe Ligges writes: >> 2) As part of the binary package build process, run CHECK >>with R_CHECK_FORCE_SUGGESTS = false. > 1, 3-5 sound fine, but I do not see why you need 2). I suppose because it makes me feel dirty to leave the check step out entirely, if there is some utility available

Re: [Rd] Monkey patching +.POSIXt

2009-09-09 Thread Mark.Bravington
Hi Hadley > This summer I've been working with a grad student to bring more of the > date time classes from JODA (http://joda-time.sourceforge.net/) into > R. To make these work seamlessly with existing date time objects, we > need to patch +.POSIXt. (The ruby community uses the term > monkey-patc

[Rd] 'make install' fails on Solaris (PR#13946)

2009-09-09 Thread bownes
Full_Name: Bob Bownes Version: 2.9.2 OS: Solaris 10 Submission from: (NULL) (164.55.254.106) The sed lines in src/unix/Makefile confuse the grep distributed with Solaris that gets configured by ./configure. Switching from a separator of ':' to a separator of ',' fixes the problem. 76,77c76,77

Re: [Rd] Monkey patching +.POSIXt

2009-09-09 Thread Hadley Wickham
> > In this particular case, the trick is to assign the new version both into the > namespace and into the environment '.__S3MethodsTable__.' inside the > namespace. The problem is +.POSIXt doesn't seem to be there: > exists("+.POSIXt", asNamespace("base")$.__S3MethodsTable__., inherits=F) [1]

Re: [Rd] Monkey patching +.POSIXt

2009-09-09 Thread Mark.Bravington
Hmmm... 'assign.to.base( "+.POSIXt", myfun)' works on my system (2.9.1 patched on Windows, at time of writing). Could be the 'mvbutils' version, I guess. What happened when you tried it? And what if you did 'getAnywhere( "+.POSIXt")' afterwards? I was wrong about where '+.POSIXt' lives, though-

Re: [Rd] 'make install' fails on Solaris (PR#13946)

2009-09-09 Thread Prof Brian Ripley
On Thu, 10 Sep 2009, bow...@gmail.com wrote: Full_Name: Bob Bownes Version: 2.9.2 OS: Solaris 10 Submission from: (NULL) (164.55.254.106) The sed lines in src/unix/Makefile confuse the grep distributed with Solaris that gets configured by ./configure. Well, it calls sed not grep! Which vers

Re: [Rd] 'make install' fails on Solaris (PR#13946)

2009-09-09 Thread Peter Dalgaard
Prof Brian Ripley wrote: On Thu, 10 Sep 2009, bow...@gmail.com wrote: Full_Name: Bob Bownes Version: 2.9.2 OS: Solaris 10 Submission from: (NULL) (164.55.254.106) The sed lines in src/unix/Makefile confuse the grep distributed with Solaris that gets configured by ./configure. Well, it cal