Learning R: Using Sweave on OS X 10.6 and fix the Sweave.sty problem

This blog shows a very clear tutorial on how connecting R-sweave to your Latex system. R-sweave (you can see it in the “New” button >> “R Sweave”) is a facility in R environment to generate neat report based on your R code. This function allows us to make a document report of your R codes, on Latex format. The fun thing is R-sweave will run your codes then put it in your Latex doc report automatically.

For you that are “still” using MS Word, you’ll have to copy-paste your R codes to the Word doc back and forth (but there’s “Pandoc” or “Pander” package that do the converting for you.

Thanks to Friedrich Leisch for sharing the tutorial.

Life as Clay

I’m trying to teach myself R for a work-related project. The documentation is absolutely terrible for beginners, which is a shame, since the language is easy. Stuff that should take 1 minute takes 4 hours because there is a paucity of good tutorials on the Internet.

R comes with Sweave preinstalled. The concept is pretty cool. If you want to lay out your journal article or publication using LaTeX, then Sweave allows you to imbed the R code in the LaTeX document. It goes like this:

  1. You have two things: your source data file and your R code.
  2. You put the R code into a file that Sweave will process. That file can have several different extensions, like .Snw or .Rnw, for example. The Sweave file also includes your LaTeX code for formatting the final document.
  3. From within the R environment (this also can be done from the command line)…

View original post 383 more words

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s