[Rd] Avoid warning in a foreign package (maptools) when loaded via depends

2010-11-11 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Hi everybody, Currently I'm in the process of developing an R library, where I make use of pointLabel in the maptools package. I've defined the dependency on package maptools via the DESCRIPTION file in the root directory of my library. Since the loading of package maptools issues a

[Rd] Reminder Special issue of the JSS on Graphical User Interfaces for R

2010-11-11 Thread Pedro Valero-Mora
Special issue of the Journal of Statistical Software on Graphical User Interfaces for R Editors: Pedro Valero-Mora and Rubén Ledesma Along its almost 15 years of existence, R has managed to gain an ever-increasing percentage of academic and professional statisticians but the spread of its use

[Rd] S4 setMethod, setGeneric and default arguments

2010-11-11 Thread evilphil
Hi Guys I have defined a generic function, for which one of the arguments has a default: setGeneric( getFwdRate, function(.Object, tenorFrom, tenorTo=tenorFrom) standardGeneric(getFwdRate) ) Then I have defined a method which also has a default: setMethod( getFwdRate,

Re: [Rd] callNextMethod fails with $ generic

2010-11-11 Thread Vitalie S.
John Chambers j...@stanford.edu writes: The problem here is that the primitive for `$` does not use standard R evaluation on its second argument, so when it is selected as the next method the call is effectively x$name regardless of the original call. If possible, I would avoid such cascaded

[Rd] Evaluation puzzle

2010-11-11 Thread Terry Therneau
The survexp function can fail when called from another function. The why of this has me baffled, however. Here is a simple test case, using a very stripped down version of survexp: survexp.test - function(formula, data, weights, subset, na.action, rmap, times, cohort=TRUE,

Re: [Rd] Evaluation puzzle

2010-11-11 Thread Gabor Grothendieck
On Thu, Nov 11, 2010 at 3:08 PM, Terry Therneau thern...@mayo.edu wrote: The survexp function can fail when called from another function.  The why of this has me baffled, however. Here is a simple test case, using a very stripped down version of survexp: survexp.test - function(formula,

Re: [Rd] Evaluation puzzle

2010-11-11 Thread Terry Therneau
Gabor wrote: At the above statement you have lost the environment of your formula. m$formula - tform Replace this with: m$formula - as.formula(tform, environment(formula)) -- No, I have not lost an environment. I manufactured a formula which lacked something

Re: [Rd] Evaluation puzzle

2010-11-11 Thread Kevin R. Coombes
Hi Terry, This may not really be a complete answer, but there seems to be a difference in eval'ing an expression compared to eval'ing a call (even though both are documented in the help page for eval as working just fine). If you insert the line print(eval(expression(zed),

Re: [Rd] Evaluation puzzle

2010-11-11 Thread Gabor Grothendieck
On Thu, Nov 11, 2010 at 5:27 PM, Terry Therneau thern...@mayo.edu wrote: Gabor wrote:  At the above statement you have lost the environment of your formula.    m$formula - tform Replace this with: m$formula - as.formula(tform, environment(formula)) --  No, I have not

Re: [Rd] Evaluation puzzle

2010-11-11 Thread Terry Therneau
Kevin, The answer came from Gabor -- the model.frame function has a non-standard evaluation, in that it uses the enviromnent attached to the formula as the enclosure for looking up variable names. This is clearly documented and I somehow missed it when reading the page. So reading deficit is

Re: [Rd] Evaluation puzzle

2010-11-11 Thread Peter Dalgaard
On 11/11/2010 11:27 PM, Terry Therneau wrote: I'm still puzzled by recover though. It looks like a buglet. You get to the right frame (try ls()) but the called from message is off by four frames. E.g. Selection: 1 Called from: model.frame(formula = zed ~ 1+age+sex+year, data = mydata)

Re: [Rd] installed.packages Error: subscript out of bounds

2010-11-11 Thread Hervé Pagès
I can see this has been addressed, thanks! I found a couple more issues with installed.packages(). The values returned in the Archs column don't seem to really make sense on Unix: installed.packages()[1:5, c(Version, Archs, Built)] Version Archs Built affxparser

[Rd] installing dependencies: binary vs source

2010-11-11 Thread Hervé Pagès
Hi, Installing from binaries on Windows: install.packages(multtest) Warning: dependency 'Biobase' is not available trying URL 'http://cran.fhcrc.org/bin/windows/contrib/2.12/multtest_2.6.0.zip' Content type 'application/zip' length 1645590 bytes (1.6 Mb) opened URL downloaded 1.6

Re: [Rd] Problem with system2(), directing STDERR to a file

2010-11-11 Thread Dan Tenenbaum
I notice that a fix for this issue was checked in. Thanks, much appreciated! But it still seems broken on Windows. Given the same ruby script, and this R code: cmd - c:/ruby192/bin/ruby args - c(test.rb) t - tempfile() system2(cmd, args, stdout=TRUE, stderr=t) [1] stderr stdout