[This article was first published on Gregor Gorjanc (gg), and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
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
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 about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.