Category Archives: R

Creating an R package

I recently put all the EcoIP application into an R package. I was surprised at how easy it was and I wanted to share my experience :) Root Path Everything that is to be packaged needs to be in a … Continue reading

Posted in R | Tagged , , , , , , , , | Leave a comment

R. create a plot with non overlapping labels

The X axis labels were a bit long and they were having trouble fitting into the plot correctly. I tried various solutions: R’s default and maptool’s pointLabel. The first did not really allow me to turn the labels 90 deg … Continue reading

Posted in commands, R | Tagged , , , , , , | Leave a comment

R: How to suppress package startup messages

suppressPackageStartupMessages(library(fields)) And you can still test the result of the `library` or `require` calls: a = suppressPackageStartupMessages(require(fields)) Variable ‘a’ will be TRUE if it was successful, FALSE otherwise.

Posted in R | Tagged , , , | 2 Comments

Very Painful EBImage install on Windows

Short Version Follow this to install EBImage Go here to get GTK+. I used this one. Make sure you add the GTK+ “bin” directory to the path. If you have zlib1.dll problems, or any problems regarding the specific dll that is … Continue reading

Posted in commands, R | Tagged , , , , , , , , , | Leave a comment

Rscript, where were you all along?

One of the things that I did not like about using R was that there was not “easy” way of calling it in a command sort of way. The test part of my R workflow consisted in going into the … Continue reading

Posted in commands, PhD, R | Tagged , , , , , , , , , | Leave a comment

R: Index of an interval of a number in a vector

Try findInterval :). Let me try to explain what I mean with this title. I have a vector of numbers. The numbers represent bin limits. For example c(1,2,3) is a vector that represents 2 bins. The first is [1,2) and … Continue reading

Posted in commands, R | Tagged , , , , , , | Leave a comment

R: Efficient data loading

I’m working with the HOG_01 directory from this dataset.  They have organized so that each data point is a 1568 line text file.  The data sets are also separated in 43 types.  Unzip the data and you will see what … Continue reading

Posted in commands, PhD, R | Leave a comment