Articles by Gregor

Subsetting made easy

February 27, 2012 | Gregor

Calculating characteristics such as median, mean,… of a subset of data is quite straightforward in R: For a data set containing results from several “models”, a subset for the model “base” is created by Then, the median of the variable … Continue reading → [Read more...]

Boxplots without boxes

June 14, 2011 | Gregor

Let’s say you have several categories with multiple data points each that you would like to plot as individual points. Even if you have only a single point, the R graphics package will plot a line (without a box for … Continue reading → [Read more...]

R in a nutshell

June 1, 2011 | Gregor

I got this book as a reference for my work with R and do like it. Just after browsing the chapters I already found some useful hints about loading and manipulating data, e.g., loading of fixed-width data files! [Read more...]

More fun with boxplots

May 19, 2011 | Gregor

Here are a few more plotting options for boxplots: Let’s start plotting the full set plot(b$mod, b$x) Plot labels for a subset in full set plot (label all points x __ -1) text(subset(b$mod, b$x __ -1), subset(b$x, b$x __ -1), … Continue reading → [Read more...]

Mapping points

May 16, 2011 | Gregor

Since I look at mercury concentrations at different measurement stations in North America, visualization using a map with values (of your favourite parameter) plotted as colour-coded circles is quite useful. After some trial & error, here is some very basic code … Continue reading → [Read more...]

More fun with sed

March 18, 2011 | Gregor

So I have this strange date and time string, which I would like to convert to a “useable” date, i.e., something that a spreadsheet programme or R can work with. It looks like this (MON has 3 chars): ddMONyr:hh:mm:ss The … Continue reading → [Read more...]

Converting text files with sed

March 3, 2011 | Gregor

Sed is my friend to change fixed-width text files (e.g., from an R screen output) to a comma delimited file using sed 's/ */,/g' file1 __file2.csv Note the two spaces between s/ and */. [Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)