Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I wanted to write about creating R-packages in Windows but after trying to get StatET to work seamlessly in Windows I decided that maybe I should start with the very basics. I found Longhow Lam’s excellent PDF about StatET in a Windows environment to be very helpful.
My basic setup:
OS: Windows 7 64-bit
R: 2.15.1 64-bit
Eclipse: Juno (3.8) 64-bit – Eclipse 4.2.0
StatET: 3.1
Eclipse
You can download Eclipse here. I always find the number of different Eclipse versions confusing but I don’t think it matters that much which one you choose. I currently use the Eclipse IDE for JavaScript Web Developers since I do a lot of PHP & JavaScript coding but I think the Eclipse Classic should be enough. Choose 32-bit or 64-bit to match your system, if your unsure what to choose then go with the 32-bit since that will always work.
R
I guess this is overdoing it… but yes you need to also have R installed, you can get it here.
StatET
Use the 3.1 StatET plugin since the old doesn’t support R-2.15 (use http://download.walware.de/eclipse-3.8).
Install StatET by going to Help > Install new software… (yes, it makes absolutely no sense why you put install new software under help but that’s just one of those things you get used to). Enter the address, choose the packages click next/finish on the following boxes (if you can’t click next then click on accept the license and don’t worry about the warning “unsigned content”):
Sometimes the install process complains about JDK required. Check that you have http://download.eclipse.org/releases/juno in the list of available sites.
If you start up the welcome screen after restarting eclipse (go to the tutorial tab if you’re not there) you can immediately choose “Configure and Launch R Console” and follow the instructions. If you’ve missed that part, go to Window > Preferences (yes, you wouldn’t expect preferences under the windows menu…) and then scroll down to StatET:
Now choose Add and choose Try find automatically or Browse file system:
Name the new console (not sure this really matters that much), go to the R Config tab and select the R config (I guess the default is the best option). Now click Apply.
Installing the R-packages
Now leave Eclipse and start a regular R session. Install the rj & rj.gd packages from WalWare (hmm… the name makes me think of malware but I guess that’s just me):
install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-1.1")
Run R console in Eclipse
To start up R you click on the run button in the lower right corner when selecting the console that you’ve previously set up:
Troubleshooting crash on indexing
The first time you start the console you’re asked about indexing the library. I’ve had some trouble here – Eclipse was kept crashing with a “JVM terminated. Exit code = -1″
Done!
Hopefully it should work now. At least it does for me
I will try to get back with some more on configuring the StatET tools.
Update on Windows 8
On my new laptop with Windows 8 and Eclipse Juno 4.2 – I have to run R through Rterm. Not yet figured out what’s missing…
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.