R

Slow R graphics via SSH

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. 

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

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)

 

Shrinking R’s PDF output

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 the raster) represented in the pdf and would rather have it reduced in size somehow.  So I wrote an R function to automate the following:

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 

Tags: 

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 

Subscribe to RSS - R