Speed up R! Make R Run Faster!

June 16, 2008
By

This is another example of why defaults matter a lot. I got an email of Evan Cooch forward by Matt, saying that there exists a trick to speed up R matrix caculation. He found that if we replace the default Rblas.dll in R with the proper one. It can b...

Read more »

Paper describing the weaver package published in Computational Statistics

June 14, 2008
By

It seems like a lifetime ago that I developed the weaver package for caching code chunks in Sweave documents. The paper that I presented at the DSC 2007 has finally been published in Computational Statistics. The title is Caching Code Chunks in Dynamic Documents: The weaver package. Here’s the abstract: Authoring dynamic documents

Read more »

Paper describing the weaver package published in Computational Statistics

June 14, 2008
By

It seems like a lifetime ago that I developed the weaver package for caching code chunks in Sweave documents. The paper that I presented at the DSC 2007 has finally been published in Computational Statistics. The title is Caching Code Chunks in Dynam...

Read more »

Unmessing my pdfs.

Unmessing my pdfs.

If you google on ‘papers’, the first hit you’ll get is http://mekentosj.com/papers/: linking to mekentosj’ Papers program. The fact that it is the first hit on google shows that it is a popular program -- or at least that a lot ...

Read more »

The disappearing mouse pointer…

The disappearing mouse pointer…

While designing an fMRI experiment, I ran into the problem that the mouse pointer disappears as soon as you start typing on a mac. In itself it is actually a handy feature -- hiding the mouse pointer makes sense as long as you’re typing -- but no...

Read more »

S3 vs S4, efficiency issues

May 23, 2008
By
S3 vs S4, efficiency issues

While developing some new simulation code with S4 system I stumbled upon some big difficulties in terms of computational efficiency. That lead me to diging into archives of Rhelp and Rdevel looking for clues. I found some interesting threads that address almost exactly the same problems that I do. Read for yourself here and here,

Read more »

R2jags: A Package for Running jags from R

May 21, 2008
By

I have wrote about my experience with jags here. Martyn Plummer has updated jags recently and now jags can get as he claimed. Jags is fast and its source code is more manipulable (It's written in C++).I and Masanao wrote a package, R2jags, for runnin...

Read more »

R2jags: A Package for Running jags from R

May 21, 2008
By

I have wrote about my experience with jags here. Martyn Plummer has updated jags recently and now jags can get as he claimed. Jags is fast and its source code is more manipulable (It's written in C++).I and Masanao wrote a package, R2jags, for runnin...

Read more »

JAGS 1.0.2 is released

May 9, 2008
By
JAGS 1.0.2 is released

JAGS 1.0.2 is now out. This is a patched release for the stable version, so there are no major changes in library functionality.   The major changes are: Memory leaks fixed. The rjags package now runs on Windows. A binary version … Continue reading →

Read more »

Multiple Assignments or the Idiosyncrasies of R and SAS

May 8, 2008
By
Multiple Assignments or the Idiosyncrasies of R and SAS

Working on top of someone else’s code at work a couple of weeks ago I stumbled upon a piece of SAS code that went like this: View Code SAS1 2 3 length check 3; ... check = Name = 'Netter' Being raised in the land of open-source and having programmed in R since I was

Read more »

Error capture

May 6, 2008
By

In a recent post to r-sig-ecology, Mike Colvin suggested the following to capture errors within a loop:for (i in 1:1000){fit<-try(lm(y~x,dataset))results<- ifelse(class(fit)=="try-error", NA, fit$coefficients)}

Read more »

Error capture

May 6, 2008
By

In a recent post to r-sig-ecology, Mike Colvin suggested the following to capture errors within a loop:for (i in 1:1000){fit<-try(lm(y~x,dataset))results<- ifelse(class(fit)=="try-error", NA, fit$coefficients)}

Read more »

How to make SVN work on R-Forge and your local driver?

May 2, 2008
By

R has a new platform-R-Forge-that enables developers and users to communicate with each other. More importantly, it is a version control platform that enables different developers to keep track on what others have been working on. So that ideally, if...

Read more »

How to make SVN work on R-Forge and your local driver?

May 2, 2008
By

R has a new platform-R-Forge-that enables developers and users to communicate with each other. More importantly, it is a version control platform that enables different developers to keep track on what others have been working on. So that ideally, if...

Read more »

Paper on GillespieSSA now published

May 2, 2008
By
Paper on GillespieSSA now published

My paper on the GillespieSSA package has now been published in the latest volume of Journal of Statistical Software. Check it out.

Read more »

speed issue in R computing: apply() vs a loop

April 23, 2008
By

In R, apply() is NOT faster than a loop!!I don't know where I pick up this perception about apply() being faster than a loop in R. For a long time, I always think that apply() runs a function (for example, mean()) on a data structure (row or column) i...

Read more »

speed issue in R computing: apply() vs a loop

April 23, 2008
By

In R, apply() is NOT faster than a loop!!I don't know where I pick up this perception about apply() being faster than a loop in R. For a long time, I always think that apply() runs a function (for example, mean()) on a data structure (row or column) i...

Read more »

An R Wiki

April 21, 2008
By
An R Wiki

It’s been ages since I visited the R website, so I don’t know how long they’ve had a wiki. It’s built using DokuWiki, one of my personal favourites. This is a great leap forward for R documentation, which is somewhat notorious for being (a) difficult to find and (b) difficult to understand when you find

Read more »

The CDK/Metabolomics/Chemometrics Unconference results

April 7, 2008
By
The CDK/Metabolomics/Chemometrics Unconference results

As announced earlier, Miguel, Velitchka, Christoph and I held a small CDK/Metabolomics/Chemometrics unconference. We started late, and did not have an evening program, resulting in not overly much results. However, we did do molecular chemometrics.We u...

Read more »

Heteroscedasticity

April 6, 2008
By

If a model is estimated using the following code: lm(y~x1+x2)->p 1. bptest(p) does the Breuch Pagan test to formally check presence of heteroscedasticity. To use bptest, you will have to call lmtest library. 2. If the test is positive (low p value), you should see if any transformation of the dependent variable helps you eliminate

Read more »

R workshop

March 28, 2008
By
R workshop

There was an R workshop on 28–29 June, just before the Australian Statistical Conference. I put in an appearance on the second day giving two talks. Time series and forecasting in R handout slides Building R packages for Windows handout slides

Read more »

R workshop

March 28, 2008
By

There was an R workshop on 28-29 June, just before the Australian Statistical Conference. I put in an appearance on the second day giving two talks. Time series and forecasting in R handout slides Building R packages for Windows handout slides

Read more »

Plotting contours

March 18, 2008
By
Plotting contours

Plenty of packages allow you to plot contours of a "z" value; however, I wanted to be able to plot a specific density contour of a sample from a bivariate distribution over a plot that was a function of the x and y parameters. The example only plots th...

Read more »

Plotting contours

March 18, 2008
By
Plotting contours

Plenty of packages allow you to plot contours of a "z" value; however, I wanted to be able to plot a specific density contour of a sample from a bivariate distribution over a plot that was a function of the x and y parameters. The example only plots th...

Read more »

An Example for Just Another Gibbs Sampler (JAGS)

March 4, 2008
By

JAGS is a cross platform BUGS. Because it runs in a command mode, it is somewhat faster than other BUGS. However, I found it is a bit tacky to use it as a Windows/PC user. I found the manual very useful but some of the language is a bit uncommon to regular users. For instance, compile [,nthins( < n...

Read more »

An Example for Just Another Gibbs Sampler (JAGS)

March 4, 2008
By

JAGS is a cross platform BUGS. Because it runs in a command mode, it is somewhat faster than other BUGS. However, I found it is a bit tacky to use it as a Windows/PC user. I found the manual very useful but some of the language is a bit uncommon to regular users. For instance, compile [,nthins( < n...

Read more »

Writing Rd files in Vim

March 3, 2008
By
Writing Rd files in Vim

I have made a small “translation” of a portion of “Writing R Extensions” manual about the Rd files to a vimhelp format. You can find it on vim.org, under this link http://www.vim.org/scripts/script.php?script_id=2177. If that does not work just search for a script “rd” there. The script itself is called “rdhelp.txt”.

Read more »

Ordered logistic model with varying intercepts (random effects)

March 2, 2008
By

I coauthor a paper with Ozan, a friend who I know when I was TAing Bayesian Methods in ICPSR. The paper tries to see if the 9/11 has any effect on American's attitudes on Muslim. We have dataset from different years: 2 from pre-9/11 periods and 2 from ...

Read more »

Ordered logistic model with varying intercepts (random effects)

March 2, 2008
By

I coauthor a paper with Ozan, a friend who I know when I was TAing Bayesian Methods in ICPSR. The paper tries to see if the 9/11 has any effect on American's attitudes on Muslim. We have dataset from different years: 2 from pre-9/11 periods and 2 from ...

Read more »