* You are viewing the archive for the ‘R-project’ Category

Book Review: A Beginner’s Guide to R

A Beginner's Guide to R

A Beginner’s Guide to R

Alain F. Zuur, Elena N. Ieno, Erik H.W.G. Meesters
Springer, 2009

So you’ve decided to start learning R. Probably because someone in your institution, typically a gentleman with an unkempt beard who likes to rail on about open source software, has convinced you to abandon the comfortable GUI-driven statistics program you learned in undergrad. But it quickly becomes apparent that leaving the familiar point-and-click interface of JMP or Minitab or (horrors) Excel for the text-driven world of R isn’t as simple as downloading … Continue Reading

Book Review: R in a Nutshell

R in a Nutshell
R in a Nutshell
Joseph Adler
O’Reilly Media, 2010

If you’re looking for an introduction to the R computing language and statistical platform, R in a Nutshell, by Joseph Adler, may be worth a look. This book is a member of O’Reilly Media’s “In a Nutshell” series that may be familiar to you if you dabble in programming. The goal of the book is to introduce the reader to many aspects of the R language, from the basic architecture and syntax of R to some of the many available … Continue Reading

R 2.12.0 and Eclipse with StatET installation


A while back I outlined the setup process for running R under the Eclipse integrated development environment with the help of WalWare.de’s StatET plugin for Eclipse, in Windows 7. This post is an update on that procedure for the newer versions of each of the programs now available.

Specifically, this information pertains to an installation of Eclipse 3.6 (Helios), StatET version 0.9.1.b201011060900E36sw, and R 2.12.0, under Windows 7 64-bit (circa December 2010). The process for making R work within Eclipse has become a bit more … Continue Reading

Sorting out Sweave in Eclipse/StatET

Using Sweave to produce pretty-looking documentation for R is awfully handy. It takes a little tweaking to get set up in Eclipse and StatET though. I followed the information in Jeromy Anglim’s webpage to originally get Sweave set up. The following is my experience getting it working with Eclipse 3.5, StatET 0.9.1.b201011060900E35sw, Sweave Add-on for StatET 0.9.0.b201011060900E35sw, MiKTeK 2.9, and R 2.12.0 i386 on Windows 7 x64 circa November 2010.

I initially wrote a .Rnw file to be run through Sweave and converted to a pdf. I then set up Eclipse to process the .Rnw file using Sweave. I … Continue Reading

Altering Eclipse user name

Using StatET’s code generation templates is handy, but the standard Eclipse variable for ${user} just inserts the currently logged-in user’s account name. If you want a different name to appear when ${user} is called, one method is to alter the eclipse.ini file.

Specifically, add the line
-Duser.name = Your full name
at the end of the .ini file.

For instance, my eclipse.ini file looks like this:
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
–launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-Duser.name=Luke Miller

When I open a new R-script file in Eclipse now, StatET automatically inserts that user name.

You can further alter the generated code in the Eclipse Preferences window. Go to Window>Preferences and you’ll get the following window.

[caption id=”attachment_502″ align=”aligncenter” … Continue Reading

Modifying basic plots in R

Below is a walk-through of some of the basics of customizing plots in R. These are all based on the graphics package that comes in the base installation of R.

Let’s start by making a basic plot in R. In the code snippets below, green text behind a # sign is considered comments by R, so everything after a # sign on a line will be ignored by R. We’ll call the plot command and supply it with two vectors of numbers representing the x and y values:

plot(c(1,2,3,4,5,6),c(4,3,6,2,1,1)) #x and y data for our example plot

which produces this plot:

[caption … Continue Reading

Eclipse and StatET – a working environment for R

In the endless search to find an interface for the R statistics package that recreates the features of my favorite Matlab development environment, I finally ran across the Eclipse and StatET combination. The Eclipse project produces the program that acts as the integrated development environment (also useful for Java development, php development, perl scripting etc.). To integrate your R installation into this development environment, you use the StatET plug-in for Eclipse, available at http://www.walware.de/?page=/it/statet/. The result looks like the picture below:

[caption id=”attachment_195″ align=”aligncenter” width=”300″ caption=”The Eclipse/StatET development environment for R. There aren't normally crudely drawn … Continue Reading

Calculating LT50 (median lethal temperature, aka LD50) quickly in R

Say you’ve got a bunch of survival/mortality data from an experiment. Maybe you exposed batches of snails to various high temperatures for a few hours, and recorded the number alive and dead in each batch at the end. Now you’d like to report the median lethal temperature (or perhaps a lethal dosage if you were injecting stuff into critters). We can do this fairly quickly using R statistical software to perform a logistic regression and back-calculate the LT50.

This assumes that you already have R installed on your computer and you know how to fire it up.

To start with, we need … Continue Reading

Page 4 of 41234