开发者

Getting Started with Sweave, Eclipse, and R

I am very new to LaTex and R, but I am learning on a daily basis. I really am getting into using Eclipse and want to join the party and start automating my work using Sweave; I am excited for the prospects.

That said, I followed Jeromy's post here and think (keyword, think) that everything is set up correctly. However, since I am very new to LaTex, how can I test it to know that I am up and running and can indeed create pdf's?

Simply, I want to 开发者_高级运维test that my configurations are up and running before I start diving into templates and creating reports. What is the basic process, from within Eclipse, to create a pdf?

Any help will be very much appreciated!

Thanks,

Brock


Right, assuming you're using StatEt within Eclipse, then make sure you've done the following;

  • Configured Statet under Window > Preferences ? StatEt, and setup things like your R environment.
  • Configure TexClipse under Window > Preferences > Texclipse, and tell it where your latex commands live (I'm on Windows, so this was c:\program files\miktex\miktex\
  • Make sure RJava is installed within your R environment
  • Setup the R build configuration, goto Run > Run Configurations, click the New icon and enter things like the R environment, the working directory and any parameter's you want.
  • Setup the Sweave command, goto Run > External Tools > Externals Tool Configurations, click the new icon under Sweave and I think I left everything default, to run sweave in the R console and run pdflatex

Then create an eclipse project, and within that project create a new Sweave document, StatEt should give you a skeleton template that will succesfully build, so then open the R console (either from the icon or via Run > Run As), then with your Sweave skeleton document tab selected, run Sweave (either via the icon, or via Run > External Tools > Whatever you called it)

You should then see the R bits occur in the R console, then the latex'y bits happening in the background and a little progress bar at the bottom of the window. Eventually it will finish and a new (blank) PDF will pop up.

Voila !

I'd also recomend this guide and this one


Although this was asked a long time ago, I thought I would share how I solved the 113 error. Basically you have to change the R working directory to where in your workspace you have the .Rnw file. Once this was done Sweave ran perfectly on my machine.

Best, Thomas

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜