180 likes | 314 Views
StatET – Setup and Installation. Errol Strain Errol.Strain@fda.hhs.gov 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).
E N D
StatET – Setup and Installation Errol Strain Errol.Strain@fda.hhs.gov useR! July 20th 2010
Material to Cover • Minimum Installation • Java • Eclipse • StatET • Recommended Installation • Apache, subversion, subclipse, LaTeX, Rtools • Tricks and Troubleshooting
Java (and rJava) • Sun Java (http://java.sun.com) for Linux & Windows • 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) • http://r.research.att.com/ • 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 2.11.1 on XP and Snow Leopard • rJava (version 8.4) • rj (version 0.5.0-4) • Needed for StatET RJ launch • Not available on CRAN • Download from http://www.walware.de/goto/statet • Use the terminal/console to install $ R CMD INSTALL --no-test-load rj_0.5.0-4.tar.gz • R 2.10.1 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-2.11.1\bin • Or create symbolic link from C:\R\R to C:\R\R-2.11.1 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 • http://www.murdoch-sutherland.com/Rtools/ • OS X • XCode Developer Tools • http://r.research.att.com/tools/ • Linux (Ubuntu) • Use apt-get install r-base-dev
Eclipse IDE • Download Eclipse Classic (3.6) for your OS from www.eclipse.org • 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 http://download.walware.de/eclipse-3.5 • If using 3.6, download archive from http://www.walware.de/goto/statet • Install StatET and related components • Subclipse (uses subversion) • Help -> Install New Software • http://subclipse.tigris.org/update_1.6.x • Uncheck Mylyn and Revision Graph • EGit (uses git) • Help -> Install New Software • http://download.eclipse.org/releases/helios/
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 http://www.walware.de/goto/statet • In JRE tab, add to vm arguments: "-Drjava.path=<path to rJava>" • 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) • http://www.bepress.com/bioconductor/paper2/ • MacTeX or MiKTeX • Copy style files from R-2.11.1/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, www.internal-site.org # 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 • http://subclipse.tigris.org/wiki/PluginFAQ • http://svnkit.com/kb/config-settings.html
Subversion Server Setup • Requires Apache • OS X: /etc/apache2 • Linux: /etc/httpd or /etc/apache2 • OS X Subversion Installation • http://www.sonzea.com/articles/subversion-trac.html • http://mrnovell.wordpress.com/2007/11/17/how-to-manage-your-own-subversion-repository-in-leopard/ • Ubuntu: https://help.ubuntu.com/community/Subversion • 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