StatET – Setup and Installation Errol Strain useR! July 20 th 2010
Material to Cover Minimum Installation –Java –Eclipse –StatET Recommended Installation –Apache, subversion, subclipse, LaTeX, Rtools Tricks and Troubleshooting
Java (and rJava) Sun Java ( for Linux & Windowshttp://java.sun.com –JRE 1.5 or higher –Eclipse/R/StatEt was crashing frequently with IBM java on RHEL4 x86_64 (but this may be fixed in recent versions) –Eclipse can use local JRE if necessary Windows (32-bit) –CRAN binaries work in XP OS X –CRAN binaries (Snow Leopard) – –Forced to compile, use MacPorts Linux (RHEL and Ubuntu) –CRAN binaries (RHEL 5 & Lucid Lynx) –Shared/Dynamic Libraries, compile with “--enable-R-shlib”
R and Packages Setup tested using R on XP and Snow Leopard rJava (version 8.4) rj (version ) –Needed for StatET RJ launch –Not available on CRAN –Download from –Use the terminal/console to install $ R CMD INSTALL --no-test-load rj_ tar.gz –R does not have --no-test-load option
R Path StatET uses defined R environments, not the system R path in Windows and Linux –Multiple R installations (Current version, previous working version, development version) –Terminal/Console output and default StatET output be consistent Windows XP –Settings -> Control Panel -> System -> Advanced -> Environment Variables, then edit Path variable to include C:\R\R \bin –Or create symbolic link from C:\R\R to C:\R\R and edit path to include C:\R\R\bin OS X and Linux –/Users/username/.profile –/home/username/.bashrc
Building Packages Compilers (gcc, mingw, Fortran), Perl, bitmap libraries, gzip, tar, etc. Windows –Use Rtools.exe – OS X –XCode Developer Tools – Linux (Ubuntu) –Use apt-get install r-base-dev
Eclipse IDE Download Eclipse Classic (3.6) for your OS from –Eclipse IDE for Java Developers is also supposed to work –Synaptic/Yum repository versions are usually a little behind Extract Files –One eclipse folder per user is easiest (config settings) –C:\eclipse\eclipse36 (Windows) –\home\user\eclipse\eclipse36 (Linux) –Applications Folder (OS X) Memory settings (eclipse/configuration/config.ini) –Modify/Add line to config.ini “-Xmx4096m” Select a Workspace –“C:\eclipse\workspace” or “\home\user\workspace” preferred –Makes it easier to switch machines and collaborate on projects (absolute path names) –Multiple workspaces for different large, complex projects?
Plug-Ins Help -> Install New Software –If using Eclipse 3.5, add –If using 3.6, download archive from –Install StatET and related components Subclipse (uses subversion) –Help -> Install New Software – –Uncheck Mylyn and Revision Graph EGit (uses git) –Help -> Install New Software –
Eclipse StatET/R Tutorial Installing Plug-Ins Create StatET project Specify Connector –New Console, Classic Console, Rgui, Xterm Add R Environment –Detect Default Properties/Settings –Set as Default R Console Launch Configuration Launch the console R Index
Problems? Often Java Related –Check JRE under Run Configurations –Follow suggestions from In JRE tab, add to vm arguments: "-Drjava.path= " Snow Leopard –Complains about 32-bit R with 64-bit JRE Help -> About Eclipse -> Installation Details -> Configuration Building R from source? –R CMD javareconf
Latex and Sweave Statistical Analyses and Reproducible Research (Gentleman and Lang 2004) – MacTeX or MiKTeX Copy style files from R /share/texmf to your TeX path –Linux: $HOME/texmf/tex/latex –OS X: ~/Library/texmf/tex/latex Refresh LaTeX database –texhash
Sweave Setup Sweave Run Configurations (Eclipse 3.5) –Sweave Tab Sweave Document Processing Run R CMD Sweave –Create New –LaTex Tab –Output Format: pdf Eclipse 3.6 –Run inside console –*.Rnw file must be in working directory Latex Error –TeXClipse Highlighting –Run LaTeX from the Console
Troubleshooting SVN Conflicts, SVN corrupted R files with “<<<<<<<<<.mine“ –Subversion attempts to merge files, resulting in *.mine, *.rXXX –Edit Conflicts, Mark Resolved Too many files, large files –3000+ files in a folder is too many, 100 is okay Team Cleanup (svn cleanup) –Locked files Nuclear Option –Copy affected directories, delete *.svn folders –Replace with repository version –Copy/Replace workspace files with copies –Lose subversion history
Subversion Proxy Subversion servers file on Windows C:\Documents and Settings\Errol.Strain\Application Data\Subversion [global] # http-proxy-exceptions = *.exception.com, # http-proxy-host = defaultproxy.whatever.com # http-proxy-port = 7000 # http-proxy-username = defaultusername # http-proxy-password = defaultpassword Servers file is overwritten when updating eclipse/subclipse –Keep a backup of the working copy Where to look for help – –
Subversion Server Setup Requires Apache –OS X: /etc/apache2 –Linux: /etc/httpd or /etc/apache2 OS X Subversion Installation – – own-subversion-repository-in-leopard/ own-subversion-repository-in-leopard/ Ubuntu: Problems? –Firewall settings –SVN repository permissions –Search for “apache dav svn”
Acknowledgements BD Technologies –Elaine McVey, Daniel Samarov, Julie Leonard, Dylan Wilson, Perry Haaland StatET –Stephan Wahlbrink FDA – Center for Food Safety and Nutrition