<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="http://www.r-bloggers.com/eclipse-an-alternative-to-rstudio-part-1/"></div></div><div><a data-url="http://www.r-bloggers.com/eclipse-an-alternative-to-rstudio-part-1/" data-counturl="http://www.r-bloggers.com/eclipse-an-alternative-to-rstudio-part-1/" data-count="horizontal" data-text="Eclipse – an alternative to RStudio – part 1" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://datascienceplus.com/eclipse-an-alternative-to-rstudio-part-1/"> DataScience+</a></strong>, and kindly contributed to <a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Many R users enjoy working in RStudio, but it’s not your only option for reproducible research in R. <a target="_blank" rel="nofollow" href="http://www.walware.de/">Stephen Wahlbrink</a> has written a plugin for Eclipse, <em>Statet</em>, that offers similar functionality to RStudio within the popular Eclipse framework. You can run an R console, compose a document in LaTeX with R code chunks, and link the two through Sweave and the plugin.</p>
<h2>Why choose Eclipse and Statet for R?</h2>
<p>This stack isn’t for everyone, but here are some reasons to prefer Eclipse and Statet over RStudio.</p>
<ul>
<li>You dislike software that randomly crashes and loses your work </li>
<li>You are already familiar with Eclipse and use it for other programming tasks.</li>
<li>You use two monitors. With Eclipse, you can detach and position your work windows wherever you like and make full use of all your screen space. In RStudio, the console and editor windows always remain within the application frame, limiting you to one monitor. </li>
<li>You like writing in LaTeX or need print quality output. RStudio is probably the better choice if you prefer to write in rmarkdown, but its support for LaTeX is weak. At the time of writing, RStudio will not produce a pdf from LaTeX that contains R generated graphs. Presumably, this is a bug and not a feature and it will be fixed at some point. However, the developers seem to favour markdown and HTML. Currently, support for LaTeX and pdf’s is not as good.</li>
</ul>
<h2>Installation guide</h2>
<p>The Eclipse stack is not as easy to get up and running as RStudio, but it is considerably more stable once you have it working. No worries: this tutorial will walk you through every step of the way. The instructions shown here are based on a clean install of Kubuntu 16.04 and current versions of everything else, as of May 2016. These instructions should work for any Debian based distro. Most of this will also work with Fedora/Centos/RHEL, but I have sometimes found it harder to get up to date versions of things from the repositories these distros use.</p>
<p>Eclipse is cross-platform and this stack is also available to Windows users. The installations are similar, and I specify the differences in the details section. I have used Eclipse/R/Statet on a Windows system without administrator privileges and behind a firewall. I suggest tips for other users in similar controlled environments.</p>
<p>Here is an overview of the what you need to do.</p>
<ul>
<li> Install Java. </li>
<li> Get Eclipse. </li>
<li> Install R </li>
<li> Obtain a LaTeX distribution </li>
<li> From within R, install packages rj and rj.gd from Walhbrink’s site.</li>
<li> From within Eclipse, install the Statet plugin. </li>
<li> Launch Eclipse and configure for use with R and LaTeX </li>
</ul>
<blockquote><p> <strong>Warning: </strong> Don’t mix the bitage. Go 64 bit on everything, or 32 bit. </p>
</blockquote>
<p>Most of the time, if I have an issue with installing Statet and Eclipse, it’s because I mixed 32 and 64 bit applications. The rest of the time, problems came from badly installing Java.</p>
<h3> Install Java </h3>
<p>On windows, you only need the runtime version (JRE) and you probably have this already. On Linux, you need the JDK, because R needs the JDK to compile the rj and rj.gd packages. </p>
<p><b> Get Eclipse </b>: Download the current version from <a target="_blank" rel="nofollow" href="http://www.eclipse.org/">Eclipse.org</a>. </p>
<p><b> Linux users </b>: Avoid <code>sudo apt-get install eclipse</code> and download directly from the site. The repos are often out of date.</p>
<h3> Install R </h3>
<p>You probably know how to do this already. A note to Windows users in controlled environments. Most of this can be done by users without administrative privileges. However, you will save yourself some trouble later on if you can convince your IT department to do the install for you. They can ensure that the location of your R install is preserved in the Registry. This makes it a lot easier for Eclipse to find R when you want to summon the console.</p>
<h3> Install a LaTeX distribution </h3>
<p>Windows users can install <a target="_blank" rel="nofollow" href="http://miktex.org/download">MikTex 2.9</a> from the installer. If you work behind a firewall, be sure to get the complete installation. The default provides a basic selection of packages and installs the rest as needed, on the fly. Your firewall won’t like that.</p>
<blockquote><p><strong>Warning!</strong> The <code>Recommended Download</code> is the 32 bit version. If you are going 64 bit, be sure to download the 64 bit version under <code>Other Downloads</code>.</p>
</blockquote>
<p>Linux users can use the version from the repo. If you use the synaptic package manager, go for texlive and texlive-extras, plus any other packages you expect to need. Texlive won’t install packages on the fly, so you need to get all the packages you use up front.</p>
<h3> Extra instructions for Windows users </h3>
<p>Windows users also need to inform Miktex where to find the Sweave.sty file. To do this:</p>
<ul>
<li>Open <code>Miktex Settings</code>. This program comes with the Miktex installation. There is another program called <code>Miktex Settings (Admin)</code>. Ignore this one and use the plain <code>Miktex Settings</code>.</li>
<li>Select tab <code>Roots</code>. </li>
<li>Click Add and navigate to folder <code>..\my R installation\share\texmf</code> </li>
<li>Select this folder, save and exit <code>Miktex Settings</code>. You’re done.</li>
</ul>
<p>You may have noticed that Sweave.sty is not actually in the texmf folder. It’s a couple of folders lower down, but this is the folder that Miktex needs to know about.</p>
<h3> Install R packages rj and rj.gd </h3>
<p>rj and rj.gd are R packages used to form a bridge between R and Java. You need these to run the R console from Eclipse. These packages are not hosted on Cran, and you need to download them from <a target="_blank" rel="nofollow" href="http://www.walware.de/">www.walware.de</a>.</p>
<ul>
<li> Launch R </li>
<li>Navigate to Wahlbrink’s <a target="_blank" rel="nofollow" href="http://www.walware.de/?page=/it/rj/installation.mframe">download page</a> for rj and rj.gd.</li>
<li> Copy the appropriate install code for the version you need and paste into your R console. Typically, you want the first line in the list. The other options refer to earlier versions of Statet, used with earlier versions of Eclipse. At the time of writing, you would enter the following code at the R prompt.</li>
<pre>install.packages(c(&quot;rj&quot;, &quot;rj.gd&quot;), repos=&quot;http://download.walware.de/rj-2.0&quot;)</pre>
<li>Quit R</li>
</ul>
<p>Under Linux, the previous step may take a few moments while the packages compile. You may get an error message to the effect that the system <em>could not compile a simple JNI program</em>. This means that you failed to correctly install the Java JDK, or that R cannot find it. Googling the error message leads to a <a target="_blank" rel="nofollow" href="http://stackoverflow.com/a/24709594/1904680">helpful post</a> on Stack-Overflow, which should resolve the issue. Basically, you need to run <code>sudo R CMD javareconf</code> before attempting to install rj and rj.gd.</p>
<p>If you work behind a firewall, you can do a manual install by downloading the packages from Walware through your browser, .</p>
<h3> Installing the Statet plugin </h3>
<p>From Eclipse, install the Statet plugin. As with rj, the plugin can be downloaded and installed manually, or installed on the fly from Eclipse. You want the version that works with the version of Eclipse that you previously installed. In most cases, you will be using the current version of Eclipse with the most recent version of Statet, but if you have reason to maintain a legacy system, earlier versions of Statet are still available on Walware.</p>
<p>In the following screenshots, I install the current version for use with Mars Eclipse. You can click on the images to enlarge them.</p>
<p>Check Walware for the current version of statet and copy the download url. The cursor on the my screenshot (low and center) points towards the line I need to copy.<br>
<a title="" data-rel="lightbox-0" target="_blank" href="http://i1.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00002.png"><img sizes="(max-width: 490px) 100vw, 490px" srcset="http://i0.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00002-490x275.png?resize=456%2C256 490w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00002-768x432.png 768w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00002-1024x576.png 1024w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00002-600x337.png 600w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00002-300x169.png 300w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00002.png 1366w" alt="Kazam_screenshot_00002" class="wp-image-4228" src="http://i0.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00002-490x275.png?resize=456%2C256" data-recalc-dims="1"></a></p>
<p>Now launch Eclipse. Select Help -> Install New Software.<br>
<a title="" data-rel="lightbox-1" target="_blank" href="http://i2.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00001.png"><img sizes="(max-width: 490px) 100vw, 490px" srcset="http://i0.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00001-490x275.png?resize=456%2C256 490w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00001-768x432.png 768w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00001-1024x576.png 1024w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00001-600x337.png 600w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00001-300x169.png 300w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00001.png 1366w" alt="Kazam_screenshot_00001" class="wp-image-4231" src="http://i0.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00001-490x275.png?resize=456%2C256" data-recalc-dims="1"></a></p>
<p>Click Add (top right). A form opens where you paste the URL from Walware. You can also give the plugin a name. On the screenshot, I’m about to click OK.<br>
<a title="" data-rel="lightbox-2" target="_blank" href="http://i2.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00003.png"><img sizes="(max-width: 490px) 100vw, 490px" srcset="http://i1.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00003-490x275.png?resize=456%2C256 490w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00003-768x432.png 768w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00003-1024x576.png 1024w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00003-600x337.png 600w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00003-300x169.png 300w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00003.png 1366w" alt="Kazam_screenshot_00003" class="wp-image-4232" src="http://i1.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00003-490x275.png?resize=456%2C256" data-recalc-dims="1"></a></p>
<p>Eclipse goes onto the Internet and retrieves some information from Walware. It finds 5 plugins. Check the box beside Statet. Do not select the other boxes.<br>
<a title="" data-rel="lightbox-3" target="_blank" href="http://i1.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00004.png"><img sizes="(max-width: 490px) 100vw, 490px" srcset="http://i1.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00004-490x275.png?resize=456%2C256 490w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00004-768x432.png 768w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00004-1024x576.png 1024w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00004-600x337.png 600w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00004-300x169.png 300w, http://datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00004.png 1366w" alt="Kazam_screenshot_00004" class="wp-image-4233" src="http://i1.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00004-490x275.png?resize=456%2C256" data-recalc-dims="1"></a></p>
<p>Click Next. The plugin will now download and install. Various screens will appear asking you to agree to the license and warning about unsigned content. Agree to everything and accept everything. Congratulations! You have Statet.</p>
<p>While we’re installing things, let’s grab <a target="_blank" rel="nofollow" href="http://www.ahtik.com/blog/eclipse-word-wrap/">Ahti Kitsik’s</a> word wrap plugin. As before, select Help -> Install New Software. Click Add and insert Ahti’s download url for the plugin, <code>http://www.ahtik.com/eclipse-update/</code>. Give it a useful name, click OK and proceed as before.<br>
<a title="" data-rel="lightbox-4" target="_blank" href="http://i2.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00006.png"><img alt="Installing Ahti Kitsik's word wrap plugin." class="wp-image-4233" src="http://i2.wp.com/datascienceplus.com/wp-content/uploads/2016/06/Kazam_screenshot_00006-490x275.png?resize=456%2C256" data-recalc-dims="1"></a> </p>
<p>Now exit Eclipse to complete the installation.</p>
<h3>Configuring Eclipse </h3>
<p>We have all the tools, but we’re not done yet. We still need to configure Eclipse so that it knows:</p>
<ul>
<li> Where to find the R version you are using</li>
<li> How you want to run R (from which folder, with which Java, etc.)</li>
<li> Where to find LaTeX and how to run it.</li>
</ul>
<p>If you have never used Eclipse before, it is easy to get lost at this point. I have supplied detailed instructions with screen shots in part 2 of this tutorial.</p>
<ul></ul>
<p><strong>
<p>Related Post</p>
<p>
<ol>
<li><a title="Permanent Link toHow to use R for matching samples (propensity score)" target="_blank" rel="bookmark" href="http://datascienceplus.com/how-to-use-r-for-matching-samples-propensity-score/">How to use R for matching samples (propensity score)</a></li>
<li><a title="Permanent Link toR for Publication by Page Piccinini: Lesson 1 – R Basics" target="_blank" rel="bookmark" href="http://datascienceplus.com/r-for-publication-by-page-piccinini-lesson-1-r-basics/">R for Publication by Page Piccinini: Lesson 1 – R Basics</a></li>
<li><a title="Permanent Link toR for Publication by Page Piccinini: Lesson 0 – Introduction and Set-up" target="_blank" rel="bookmark" href="http://datascienceplus.com/r-for-publication-by-page-piccinini-lesson-0-introduction-and-set-up/">R for Publication by Page Piccinini: Lesson 0 – Introduction and Set-up</a></li>
<li><a title="Permanent Link toHow to export Regression results from R to MS Word" target="_blank" rel="bookmark" href="http://datascienceplus.com/how-to-export-regression-results-from-r-to-ms-word/">How to export Regression results from R to MS Word</a></li>
<li><a title="Permanent Link toLearn R by Intensive Practice" target="_blank" rel="bookmark" href="http://datascienceplus.com/learn-r-by-intensive-practice/">Learn R by Intensive Practice</a></li>
</ol></strong>
<div>
<a target="_blank" href="http://feeds.feedburner.com/~ff/datascienceplus?a=QqPybMdRvBI:RPAV9TYJon4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/datascienceplus?i=QqPybMdRvBI:RPAV9TYJon4:D7DqB2pKExk" border="0"></a> <a target="_blank" href="http://feeds.feedburner.com/~ff/datascienceplus?a=QqPybMdRvBI:RPAV9TYJon4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/datascienceplus?d=qj6IDK7rITs" border="0"></a> <a target="_blank" href="http://feeds.feedburner.com/~ff/datascienceplus?a=QqPybMdRvBI:RPAV9TYJon4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/datascienceplus?d=yIl2AUoC8zA" border="0"></a>
</div>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="http://www.r-bloggers.com/eclipse-an-alternative-to-rstudio-part-1/"></div></div><div><a data-url="http://www.r-bloggers.com/eclipse-an-alternative-to-rstudio-part-1/" data-counturl="http://www.r-bloggers.com/eclipse-an-alternative-to-rstudio-part-1/" data-count="vertical" data-text="Eclipse – an alternative to RStudio – part 1" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://datascienceplus.com/eclipse-an-alternative-to-rstudio-part-1/"> DataScience+</a></strong>.</div>
<hr>
<a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="http://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="http://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="http://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="http://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/zO7d0I_1CVE"></a></div>