Add a basic R solution

This could definitely be cleaner/better. I'm not much of an R
programmer.