Blog Archives

Predicting the memory usage of an R object containing numbers

To estimate if a certain vector of numbers will fit into memory, you can quite easily predict the memory usage based on the size of the vector. An integer vector will use 4 bytes per number, and a numeric vector

See more ›

Tagged with:
Posted in R stuff

Custom axis transformations in ggplot2

To apply a data transformation on an axis in a ggplot, you can use coordinate transformations. For more detail see the ggplot2 documentation. A number of coordinate transformations is available, including log10 and sqrt. However, if you want to perform

See more ›

Tagged with: ,
Posted in R stuff

Cleaning sentences by recursively merging words using R

A question on StackOverflow really sparked my attention. The aim was to clean up a dataset of inappropriately spaced words. For example:

My approach was to create what I call a wordpair object. The word pair object for the

See more ›

Tagged with: ,
Posted in R stuff

Comparison of ave, ddply and data.table

This is a copy of a post by me on the R-statistics blog. Fortran and C programmers often say that interpreted languages like R are nice and all, but lack in terms of speed. How fast something works in R

See more ›

Tagged with: ,
Posted in R stuff