Added R implementations by AnantSogani and ignorant4ever(sanealytics).