[Rd] Maybe a bug in warning() for condition objects?

2006-10-02 Thread dhinds
I'm using R-2.3.1 but the code in question is the same in the 01-Oct-2006 snapshot for release 2.4.0. I'd like to evaluate an expression, catching errors and handling them as warnings. My first attempt: x <- tryCatch(lm(xyzzy), error=warning) didn't work; the error is still treated as an err

Re: [Rd] documenation duplication and proposed automatic tools

2006-10-02 Thread Henrik Bengtsson
Hi. Far from complete, but some sketches on a solution is in the Rdoc-to-Rd translator of the R.oo package. I, the author, never made this very public because it uses a very ugly parser etc for it, but the basics is there and I use it to generate \usage{} statements and class hierarchies automati

Re: [Rd] More strange [[ behaviour

2006-10-02 Thread Herve Pages
Duncan Murdoch wrote: > On 10/2/2006 3:21 PM, Herve Pages wrote: >>> a[[x=1]] >> Error in a[[x = 1]] : subscript out of bounds >> > > Indexing is a function call, with arguments x, i, j, ... . If you use > y=1, you're setting something in the "..." part of the arg list. If > you say x=1, you're s

Re: [Rd] More strange [[ behaviour

2006-10-02 Thread Duncan Murdoch
On 10/2/2006 3:21 PM, Herve Pages wrote: > Hi, > >> setClass("MyList", "list") > [1] "MyList" >> a <- new("MyList") >> a > An object of class "MyList" > list() >> setMethod("[[", "MyList", function(x, i, j, ...) cat("Just testing\n")) >> a[[]] > Just testing >> a[[1]] > Just testing >> a[[a=1]] >

[Rd] More strange [[ behaviour

2006-10-02 Thread Herve Pages
Hi, > setClass("MyList", "list") [1] "MyList" > a <- new("MyList") > a An object of class "MyList" list() > setMethod("[[", "MyList", function(x, i, j, ...) cat("Just testing\n")) > a[[]] Just testing > a[[1]] Just testing > a[[a=1]] Just testing > a[[b=1]] Just testing ... > a[[v=1]] Just testing

[Rd] documenation duplication and proposed automatic tools

2006-10-02 Thread Ross Boylan
I've been looking at documenting S4 classes and methods, though I have a feeling many of these issues apply to S3 as well. My impression is that the documentation system requires or recommends creating basically the same information in several places. I'd like to explain that, see if I'm correct,

Re: [Rd] Help for methods

2006-10-02 Thread John Chambers
The convention for documenting S4 methods provides a general way to get the documentation for a method, given the name of the function and the name(s) of the classes in the signature: method?"FUN,CLASS1,CLASS2,..." where FUN is the name of the function and CLASS1, etc. are the names of the c

[Rd] 2.3.1: interacting bugs in load() and gzfile() (PR#9271)

2006-10-02 Thread jbrzusto
Hello, If repeated calls are made to save() using the same pre-opened gzfile connection to a file, and then the connection is closed, the objects saved by the second and subsequent calls are not correctly restored by repeated calls to load() with a new gzfile connection to the same file. What fo

Re: [Rd] [R] RODBC ERROR on Rcmdr install

2006-10-02 Thread Marc Schwartz (via MN)
John et al, First, RODBC is indeed quite useful under Linux and I use it to connect to an Oracle 10g server running on RHEL. Oracle provides FREE Linux ODBC drivers that support this functionality: http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html That same

Re: [Rd] Fwd: Selfstarting models for soil hydrology using R

2006-10-02 Thread Spencer Graves
The traditional way to handle something like this is to develop your own package for R, possibly even consisting of this one example with your documentation using the standard R documentation protocol. Instructions for how to do this are contained in the "Writing R Extensions" manual, wh

Re: [Rd] [R] RODBC ERROR on Rcmdr install

2006-10-02 Thread John Fox
Dear Vittorio, Thanks for the clarification. This raises two questions: (1) If a *nix system has an ODBC driver, can one then read Excel, Access, and dBase data sets via RODBC (which is what the Rcmdr menu item in question provides for)? (2) If so, is there a way for me to detect whether unixODBC

Re: [Rd] CCF and ACF

2006-10-02 Thread Gabor Grothendieck
Using "ts" objects these can be written in the following consistent manner: > sum(ts(x) * lag(ts(x)) / sum(ts(x)^2)) [1] -0.2648633 > sum(ts(x) * lag(ts(y)) / sqrt(sum(ts(y)^2) * sum(ts(x)^2))) [1] 0.5930216 On 10/2/06, Simone Giannerini <[EMAIL PROTECTED]> wrote: > Dear all, > > given two nume

[Rd] CCF and ACF

2006-10-02 Thread Simone Giannerini
Dear all, given two numeric vectors x and y, the ACF(x) at lag k is cor(x(t),x(t+k)) while the CCF(x,y) at lag k is cor(x(t),y(t-k)). See below for a simple example. > set.seed(1) > x <- rnorm(10) > y <- rnorm(10) > x [1] -0.6264538 0.1836433 -0.8356286 1.5952808 0.3295078 -0.8204684 0.4

Re: [Rd] Trig.Rd typo (PR#9269)

2006-10-02 Thread maechler
Thank you, Robin (and Kjetil), for spotting and reporting this so precisely. This is a (somewhat rare) example of a bug that is trivial enough to fix so the fix even made it into the "deep frozen" release candidate (R 2.4.0, to be released tomorrow). Martin Maechler, ETH Zurich > "Robin" =

Re: [Rd] pdf() and postscript() fails (PR#9268)

2006-10-02 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: > Full_Name: yury bakshi > Version: R-2.3.1 > OS: XP, cygwin Is this a self compiled version? The cygwin platform is not supported. > Submission from: (NULL) (24.187.26.0) > > > >> pdf() Works for me. > Error in pdf() : failed to load default encoding > In additi

[Rd] Trig.Rd typo (PR#9269)

2006-10-02 Thread r . hankin
Full_Name: Robin Hankin Version: 2.4.0 RC OS: MacOSX 10.4.7 Submission from: (NULL) (139.166.242.29) The first cut line described in Trig.Rd for asin() is incorrect in the ascii version of the manpage. The Rd file reads: For \code{asin()} and \code{acos()}, there are two cuts, both along th