Added R codes