« Analysis in R indicates "Moderately Strong Support" for fraud in Iranian election | Main | A statistical learning web service, in R »

June 19, 2009

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a010534b1db25970b0115712f05b7970b

Listed below are links to weblogs that reference Batch mode in R: a primer:

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Most people run it from the command line?

I thought running R from scripts was the standard method. I can't imagine doing it any other way, even for simple things. It's just so much easier to type the command in a text editor, highlight it, and hit CTRL-R to run it.

I used to work in a computer lab, and one night I used 15 computers from the extra lab to run 15 different parts of my analysis simultaneously. The whirring hum of 15 processor fans hard at work for you is soothing. =)

I second that. I wouldn't even start a simple exploratory analysis directly from the interactive prompt -- how else are you going to keep track of what you're doing? And if you actually use R for work, and not just research, you'll be writing functions and calling them (and R itself) and generally scripting away as much as possible.

Still, good to link -- if anyone really does mostly run R interactively, they should see there is another way.

I use R that way too -- cut-n-paste from a script file is much faster that typing. That's still using R interactively though -- you're just automating the typing part :)

I'm surprised that in a discussion of batch mode in R there is no mention of R CMD BATCH. Certainly on Mac OS (which the author is using) and on Linux that is the preferred method of doing batch runs. Instead of

R --vanilla --slave < hello_world.R > result.txt

one would use

R CMD BATCH hello_world.R

I agree with Douglas Bates observation, ages ago I posted a basic tip about running R scripts in batch mode:

http://onertipaday.blogspot.com/2007/05/running-r-programs-on-clusters.html

HIH

I would also recommend Rscript (v easy to run and also handle command line arguments). I've posted this suggestion back in more detail to the original blog too.

Good point Doug -- R CMD BATCH was a big omission! Thanks -- I feel a new post coming on...

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Got comments or suggestions for the blog editor?
Email David Smith.

R links

Recommended Sites

Search Revolutions Blog