Re: [Rd] system on windows vs. unix

2005-09-07 Thread Martin Maechler
> "Gabor" == Gabor Grothendieck <[EMAIL PROTECTED]>
> on Wed, 7 Sep 2005 00:08:05 -0400 writes:

Gabor> The R system command has different arguments on Windows and UNIX.
Gabor> I hadn't realized that and I think it would be nice if the input=
Gabor> argument available
Gabor> on Windows were available on UNIX too and the ignore.stderr= argument
Gabor> available on
Gabor> UNIX were avaliable on Windows too.  

Gabor> Even without that I could have saved some time if the help file had
Gabor> pointed out that
Gabor> the arguments vary from OS to OS or even better which are common and 
which 
Gabor> are OS-specific.

I very much agree.

Patches (against R-devel!) are very welcome.

Regards,
Martin

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Build R with AMD pgi compiled ACML library

2005-09-07 Thread Liaw, Andy
I can only say that the last time I tried linking ACML to R, it did quite a
bit worse than Goto's BLAS.  

Andy

> From: Jennifer Lai
> 
> Hi,
>  Has anyone had any luck in using portland group compiler 
> to build 
> R(-devel) with AMD's pgi compiled ACML library? I've downloaded the 
> packages and set LD_LIBRARY_PATH, and run configuration 
> script as follow:
> % ./configure --prefix=/usr/local/R.pgcc --with-blas='-lacml'
> 
> However, it failed to pick up  double complex BLAS,
> 
> checking for sgemm_ in -lacml... yes
> checking whether double complex BLAS can be used... no
> 
> Can anyone advise me on how to fix this problem?
> Thank you in advance for your help!
> 
> Sincerely,
> Jennifer
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Tracebacks with tryCatch() and withCallingHandlers()?

2005-09-07 Thread Henrik Bengtsson
When batch processing analysis, I use tryCatch() for failure handling 
and to prevent unwanted interrupts.  I write detailed progress to log 
file and conditions (warnings and errors) are written to the same log 
file immediately by using withCallingHandlers(..., condition=function(c) 
cat(c, file=logFile)).  However, I would also like to write the call 
stack to the log file to further simplify troubleshooting;  traceback() 
does unfortunately not work here. From ?traceback, we have

  "Errors which are caught _via_ 'try' or 'tryCatch' do not generate a 
traceback, so what is printed is the call sequence for the last uncaught 
error, and not necessarily the last error."

(and it seems to be case for withCallingHandlers() too).  Does anyone 
know of a workaround for this?   Is there a way to get the call stack 
within the condition handler?

Example:

foo <- function() stop("whoops");
pre <- function() foo();
bar <- function() pre();

yo <- function(fcn=tryCatch) {
   fcn(bar(),
 error = function(ex) {
   str(ex);
   traceback();   # I would like to access the call stack here!
 }
   )
   traceback();
}

Calling these gives:

 > rm(.Traceback)
 > yo()  # Using tryCatch()
List of 2
  $ message: chr "whoops"
  $ call   : language foo()
  - attr(*, "class")= chr [1:3] "simpleError" "error" "condition"
No traceback available
No traceback available
 > traceback()
No traceback available

The same, but now with withCallingHandlers(), which does not "prevent" 
the error from interrupting the code, gives similar results
 > rm(.Traceback)
 > yo(fcn=withCallingHandlers)
List of 2
  $ message: chr "whoops"
  $ call   : language foo()
  - attr(*, "class")= chr [1:3] "simpleError" "error" "condition"
No traceback available
Error in foo() : whoops
 > traceback()
5: stop("whoops")
4: foo()
3: bar()
2: fcn(bar(), error = function(ex) {
str(ex)
traceback()
})
1: yo(fcn = withCallingHandlers)

Traceback() is available if the error is "let through".  I am also aware 
that the 'call' element of the condition object reports "foo()", (which 
is better than nothing).  However, I am missing information on the 
calling functions pre() and bar().

In addition to traceback(), I've also tried sys.calls(), sys.frames() 
and sys.status(), but none of these seems to "report" that the error 
occured inside foo(), instead you only get

$sys.calls
$sys.calls[[1]]
yo()

$sys.calls[[2]]
fcn(bar(), error = function(ex) {
 str(ex)
 traceback()
 print(sys.status())
 str(sys.calls())
 str(sys.frames())
})

$sys.calls[[3]]
tryCatchList(expr, classes, parentenv, handlers)

...

Am I looking for something that I can't get?  Would a solution be for R 
to internally record the call stack as soon as a condition occurs/is 
instanciated?

Thanks for enlightning me

Henrik

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] CRAN, Bioconductor and ctv package dependency questions

2005-09-07 Thread Gabor Grothendieck
1. Can CRAN packages depend on Bioconductor packages and still pass
R CMD check?  That is can Suggests: and Depends: in the DESCRIPTION
file contain Bioconductor packages or only other CRAN packages?
Is there an example?

2. If a package depends on a Bioconductor package does one just list
the package its dependent on or also all packages that that package
recursively depends on?  Is this the same as for CRAN packages that
a package is dependent on?

3. Suppose that the output of package A is typically processed by
package B.  Thus strictly speaking no function in A depends on any
function in B; however, the output of A is not very usable without post 
processing it by B.   Would one list A as being dependent on B anyways?

4. Are there any considerations in the above cases related to 
CRAN Task Views (ctv package)?
http://cran.r-project.org/src/contrib/Views/

5. Are the above discussed anywhere?  I looked up the Depends and Suggests
field in 1.1 of the R Extensions manual but none of the above is addressed
there.

Thanks.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Fwd: segfault

2005-09-07 Thread Deepayan Sarkar
On 8/31/05, Byron Ellis <[EMAIL PROTECTED]> wrote:
> There's definitely something a bit strange going on. The arguments as
> passed to wireframePanelCalculations from the code snippet show only
> 6060 elements for the z vector (51,101,16 respectively for x,y,rot)
> while the function routinely tries to access at positions in the z
> vector >20,000... until it eventually falls over (how long this takes
> seems to depend on circumstances, I can actually get it to complete a
> run while running in gdb).

Thanks for tracking this down. It's unlikely that I'll be able to fix
this before R 2.2.0, but at least I know where to look when I do
tackle this.

> On Aug 30, 2005, at 10:12 AM, stefano iacus wrote:
> 
> >
> > On 29/ago/05, at 10:35, Prof Brian Ripley wrote:
> >
> >
> >> It does not crash for me on either Windows or Linux, but it does
> >> take a
> >> long time and the plot is a mess, so there does seem to be a
> >> lattice-related problem (maybe a usage one).
> >>
> >> However, I think the crash is a Mac (presumably quartz()) problem.
> >>
> >>
> >
> > no, it also happens with the X11 device. BTW, it seems to be OS X
> > specific.
> > I'll try to debug
> > stefano
> >
> >
> >> On Mon, 29 Aug 2005, stefano iacus wrote:
> >>
> >>
> >>
> >>> This segfaults on OS X (10.4) on both X11 and quartz devices.
> >>> Seems a problem with lattice but I cannot test on other platforms
> >>> stefano
> >>>
> >>>
> >>> Begin forwarded message:
> >>>
> >>>
> >>>
>  From: "G. Sawitzki" <[EMAIL PROTECTED]>
>  Date: 28 agosto 2005 14:11:18 GMT+02:00
>  To: [EMAIL PROTECTED]
> 
> 
>  Dear Stefano,
> 
>   this small exaple leads to a crash of R. I did not try it on
>  versions other than the Mac version. So I am sending it to you
>  directly. If it is a littice problem, could you pass it to Deepayan
>  Sarkar? Thank you.
> 
>    g.
> 
>  ==
>  #pbinom
>  library(grid)
>  library(lattice)
> 
>  n<-20
>  psteps<-50
>  binomtable<- function (n,psteps){
>  x<-(0:(10*n))/10
>  p<- (0:psteps)/psteps
>  dd<-expand.grid(x=x,p=p)
>  dd$F<- pbinom(dd$x,n,dd$p)
>  dd$x0<-trunc(dd$x)
>  dd
>  }
> 
>  bt<-binomtable(n=5,psteps=100)
>  bt[bt$x-bt$x0>=0.9,]$F<-NA
>  wireframe(bt$F~bt$x*bt$p,bt,groups=bt$x0,shade=TRUE) # leads to R
>  crash
>  #wireframe(bt$F~bt$x*bt$p,bt,shade=TRUE) #ok
> 
> 
> >>
> >> --
> >> Brian D. Ripley,  [EMAIL PROTECTED]
> >> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> >> University of Oxford, Tel:  +44 1865 272861 (self)
> >> 1 South Parks Road, +44 1865 272866 (PA)
> >> Oxford OX1 3TG, UKFax:  +44 1865 272595
> >>
> >> __
> >> R-devel@r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-devel
> >>
> >>
> >>
> >
> > __
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
> 
> ---
> Byron Ellis ([EMAIL PROTECTED])
> "Oook" -- The Librarian
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Month recognition issue

2005-09-07 Thread Sebastien Durand
Dear all,

I am running
R : Copyright 2005, The R Foundation for Statistical Computing
Version 2.1.1  (2005-06-20), ISBN 3-900051-07-0
Under Mac os X, a french version!

I am preparing a package and I got the following issue

I am trying to read dates that are written in 
english and have them recognized by R using 
as.Date function.

I realized strangely that when I type
>  month.abb
  [1] "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct"
[11] "Nov" "Dec"

I get the abbreviated english version of every month

>  x <- c("1-jan-1960", "2-feb-1960", 
>"31-mar-1960", "30-apr-1960","2-may-1960", 
>"31-jun-1960", "30-jul-1960","2-aug-1960", 
>"31-sep-1960", "30-oct-1960", "30-nov-1960", 
>"30-dec-1960");
>  strptime(x, "%d-%b-%Y")
  [1] "1960-01-01" NA   "1960-03-31" NA
  [5] NA   NA   "1960-07-30" NA
  [9] "1960-10-01" "1960-10-30" "1960-11-30" NA

It is only once I have found through trial an 
error the french abbreviation, that I got a match 
for every month.

>  x <- c("1-jan-1960", "2-fév-1960", 
>"31-mar-1960", "30-avr-1960","2-mai-1960", 
>"31-jui-1960", "30-jul-1960","2-aoû-1960", 
>"31-sep-1960", "30-oct-1960", "30-nov-1960", 
>"30-déc-1960");
>  strptime(x, "%d-%b-%Y")
  [1] "1960-01-01" "1960-02-02" "1960-03-31" "1960-04-30"
  [5] "1960-05-02" "1960-07-01" "1960-07-30" "1960-08-02"
  [9] "1960-10-01" "1960-10-30" "1960-11-30" "1960-12-30"

I got simply two questions:

First, why since R was install on a french system 
the month.abb command didn't give me the french 
abbreviations.

Secondly, since I am producing a package, I would 
like to know how can I tell R  to momentairly use 
the english abbreviations instead of the french 
ones...

Thanks a lot

--

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Tracebacks with tryCatch() and withCallingHandlers()?

2005-09-07 Thread Kurt Hornik
> Henrik Bengtsson writes:

> When batch processing analysis, I use tryCatch() for failure handling 
> and to prevent unwanted interrupts.  I write detailed progress to log 
> file and conditions (warnings and errors) are written to the same log 
> file immediately by using withCallingHandlers(..., condition=function(c) 
> cat(c, file=logFile)).  However, I would also like to write the call 
> stack to the log file to further simplify troubleshooting;  traceback() 
> does unfortunately not work here. From ?traceback, we have

>   "Errors which are caught _via_ 'try' or 'tryCatch' do not generate a 
> traceback, so what is printed is the call sequence for the last uncaught 
> error, and not necessarily the last error."

> (and it seems to be case for withCallingHandlers() too).  Does anyone 
> know of a workaround for this?   Is there a way to get the call stack 
> within the condition handler?

tools:::.try_quietly() tries doing something similar (catch errors and
print a traceback) [the code is not necessarily a thing of beauty ...].

Hth

Best
-k

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel