Dealing with funny problems using R or Ruby