# Posts Tagged ‘ Research ’

## Converting vectors to numeric in mixed-type dataframe

May 19, 2011
By

Coercing variables of character and numeric type into a single dataframe yields all vectors to be defined as factors all <- data.frame(cbind(site, year, model, x, y, z)) The following converts selected variables from “factor” back to “numeric” all\$x <- as.numeric(x) … Continue reading →

## How to do a quantitative literature review in R

May 17, 2011
By

In the early stages of a literature review, you may have hundreds of papers and not know how to even begin sorting through them. In this post, I show you how to perform a two-stage clustering analysis with R so that you can identify the main groups within your data, based on key attributes of each paper.

## Mapping points

May 16, 2011
By

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 →

## Is R an ideal language to teach the fundamentals of programming to beginners?

May 6, 2011
By

I’m helping out some colleagues learn programming from having zero experience with it in any shape or form. It’s quite a daunting task in some senses, because, well, it may not be easy! They are researchers, so they’ll need it for processing data and generating output, and perhaps processing BIG DATA at some point too.

## Unable to plot a decent x-Axis in a time series plot using zoo

April 7, 2011
By

I use the R package zoo to plot a yearly time series of weekly averaged data. The problem is that my date variable (m.all\$date) contains week numbers and these are plotted as x-Axis. What I would rather like to to … Continue reading →

## More fun with sed

March 18, 2011
By

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 →

## Converting text files with sed

March 3, 2011
By

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 */.

January 21, 2011
By

Reconstructing phylogenies is an interesting task, sadly one that often requires to navigate between a multitude of software. To add an unnecessary layer of complexity to the whole thing, most of these softwares speaks different languages, and requires the user to do endless conversions from fasta to phylip to nexus to whatever new format they

## A (fast!) null model of bipartite networks

September 12, 2010
By
$A (fast!) null model of bipartite networks$

One of the challenges for ecologists working with trophic/interaction networks is to understand their organization. One of the possible approaches is to compare them across a random model, with more or less constraints, in order to estimate the departure from randomness. To this effect, null models have been developed. The basic idea behind a null