Added R and Python codes. Each code contain a short description of what it does and how it works at the beginning.