2010-06-29

Sweave.sh in Eclipse-StatET

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
TEXINPUTS=.::/usr/lib/R/share/texmf:

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

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:
>Main:
- location: /usr/local/bin/sweave
- working directory: ${container_loc}
- Arguments: -ld ${resource_loc}

>Refresh:
no selection

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

>Environment: added a new variable
Variable: TEXINPUTS
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

Sebastien

No comments: