Blog Archives

Slow R graphics via SSH

March 30, 2012
By

I do most of my R work on a server via SSH.  Viewing graphics (i.e. plot()) can be excruciatingly slow through the SSH pipe, but it's easy to make it fast.  Simply run:        X11.options(type="Xlib") once in the R session.  Tags:  R

Read more »

Copy all the files in a directory to a new directory using R

October 27, 2011
By

Someone asked me how to move a directory full of files from one place to another using R.  The easiest way I've found is as follows (where "oldpath" is the existing directory and "newpath" is the new directory):   file.copy(list.files(oldpath),newpath)   Tags:  R

Read more »

Shrinking R’s PDF output

June 17, 2010
By

R is great for graphics, but I've found that the PDF's R produces when drawing large plots can be extremely large. This is especially common when using spplot() to plot a large raster. I've made a 15 page PDF full of rasters that was hundreds of MB in size.  Obviously I don't need all the detail (every pixel of...

Read more »

MODIS processing with R, GDAL, and the NCO tools

June 3, 2010
By
MODIS processing with R, GDAL, and the NCO tools

I use MODIS data for analysis of vegetation dynamics around the world.  The native HDF file format provided by NASA is great for archiving the data (it's amazing how much information they include in each file), but unfortunately there aren't many tools for directly (and easily) extracting data stored across files like there are for the NetCDF format.  I...

Read more »