Re: [Rd] Sweave vignettes and bitmap on windows

2007-09-19 Thread tshort
While I don't agree with it, this "feature" of bitmap is deliberate according to Prof. Ripley: http://tolstoy.newcastle.edu.au/R/devel/04/09/0682.html - Tom Tom Short EPRI Martin Morgan wrote: > > During vignette generation on Windows, Sweave seems to clean up before > all graphics files are

Re: [Rd] xlsReadWrite Pro and embedding objects and files in Excel worksheets

2007-02-08 Thread tshort
Another option for creating XLS files it to write out HTML instead. Excel can read html files just fine, and a useful trick is giving the html file a .xls extension. So, from the user's point of view, it is an excel file even though it's just an html file. Using html works great for embedding li

Re: [Rd] Am I missing something about debugging?

2007-01-02 Thread tshort
Rather than using debug, I generally like using recover. When called, it shows the call stack, and you can pick what to view. Using option(error=recover) triggers it on errors. You can't step through code as when using browser(), but I find jumping to different points on the call stack to be more

Re: [Rd] bug in acosh (win32) (PR#9403)

2006-12-03 Thread tshort
> This is a bug in the mingw runtime, and not in R. So the difference is > between OSes, not between R versions. Note that > > > acosh(2) > [1] 1.316958 > > acosh(2+0i) > [1] 0+NaNi > > acosh(2+1e-10i) > [1] 1.316958+0i > > so it seems to be happening only for exactly real complex numbers. >

[Rd] bug in acosh (win32) (PR#9403)

2006-11-30 Thread tshort
Full_Name: Tom Short Version: 2.4.0 OS: Windows XP Submission from: (NULL) (68.236.159.227) It looks like there's a bug in acosh with complex number in windows: > acosh(2) [1] 1.316958 > acosh(2+0i) [1] 0+NaNi This happens for me on Windows XP with the following versions: R version 2.2.0, 2005-

Re: [Rd] Any interest in "merge" and "by" implementations specifically for so

2006-08-01 Thread tshort
Kevin, Whether or not the R core developers want to merge these functions in base R, they would make a great little package on CRAN. That way others could easily use them, and for yourself, the package automatically gets updated with new versions of R. It sounds like you're done with the hard par

Re: [Rd] Any interest in "merge" and "by" implementations specifically for so

2006-07-31 Thread tshort
> Hi Tom, > > > Now, try sorting and using a loop: > > > >> idx <- order(i) > >> xs <- x[idx] > >> is <- i[idx] > >> res <- array(NA, 1e6) > >> idx <- which(diff(is) > 0) > >> startidx <- c(1, idx+1) > >> endidx <- c(idx, length(xs)) > >> f1 <- function(x, startidx, endidx, FUN = sum) { > > +

Re: [Rd] Any interest in "merge" and "by" implementations specifically for so

2006-07-30 Thread tshort
Kevin, starting with your idea of sorting first, you can get some speedups just using R. Start by comparing the base case that Bill used: > x <- runif(2e6) > i <- rep(1:1e6, 2) > unix.time(res0 <- unlist(lapply(split(x,i), sum))) [1] 11.00 0.16 11.28NANA Now, try sorting and using a lo