Sweave.sh in Eclipse-StatET

June 29, 2010

(This article was first published on Gregor Gorjanc (gg), and kindly contributed to R-bloggers)

Sébastien Bihorel sent the following instructions on how to use my sweave.sh shell script in Eclipse-StatET.
1- First, you need to know the path to your TEXINPUTS settings. Type R CMD env |grep TEXINPUTS in a shell. In my installation (opensuse 11.2), the shell returned the following

2- Edit your .bashrc file (located in your home directory) and add the following statement

3- Download Gregor Gorjanc’s sweave.sh script at http://cran.r-project.org/contrib/extra/scripts/Sweave.sh. Copy it to /usr/local/bin, rename the file to sweave (mv sweave.sh sweave) and make the file executable (chmod +ax sweave) if it is not already.

4- Open Eclipse and create a new Program in External Tools Configuration using the following settings:
– location: /usr/local/bin/sweave
– working directory: ${container_loc}
– Arguments: -ld ${resource_loc}

no selection

Build before launch: checked
The project containing the selected resource: checked
Include referenced projects: checked

>Environment: added a new variable
Value: .:/usr/lib/R/share/texmf: <- Use here the path obtained at step 1 (for some reason you have to add .: before the path and : after. Do not use quotes around the Value) Append environment to native environment: checked >Common:
Local file: checked
Console encoding: default – inherited (UTF-8)
Standard Input and Ouput: Allocate console
Launch in background: checked

Now you should be able to see sweave as a new program in your main screen. Hope it helps


To leave a comment for the author, please follow the link and comment on their blog: Gregor Gorjanc (gg).

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)