Port of sofia-ml (http://code.google.com/p/sofia-ml/) to R