Blog Archives

Database Reflection using dplyr

January 22, 2014
By
Database Reflection using dplyr

At work I write a ton of SQL, and I do most of my querying using R.  The workflow goes: Create a string with the SQL in R Plug the string into fetchQuery (see my previous post) This solution works relatively well, but i’m a bit unhappy writing strings rather than using function calls. I

Read more »

Easier Database Querying with R

July 29, 2013
By
Easier Database Querying with R

I have a strong distaste for database connection management.  All I want to do when I want to query one of our many databases at work is to simply supply the query, and package the result into an R data.frame or data.table. R has many great database connection tools, including but not limited to RPostgreSQL,

Read more »

A Sequence Clustering Model in R

February 22, 2012
By
A Sequence Clustering Model in R

I’ve just released my first R package! Over the past 1.5 years or so, I’ve been studying an obscure statistical model over ranking (full, or partial) data called Mallows’ model.  It hypothesizes that a set of sequence data has a “modal” sequence about which the data cluster, and that the data fall away from that

Read more »

A spell-checker in R

February 7, 2012
By
A spell-checker in R

I came across Dr. Peter Norvig’s blog about writing a basic spell-checker (http://norvig.com/spell-correct.html), and just had to try to implement it in R. Please excuse the ugly-ish code (I have not optimized it or commented it adequately at this point, but you can get the idea of what it does by reading Dr. Norvig’s blog).

Read more »

Decoding a Substitution Cipher using Simulated Annealing

January 1, 2012
By
Decoding a Substitution Cipher using Simulated Annealing

My last post discussed a method to decode a substitution cipher using a Metropolis-Hastings algorithm. It was brought to my attention that this code could be improved by using Simulated Annealing methods to jump around the sample space and avoid some of the local maxima. Here is a basic description of the difference: In a

Read more »