R codes developed by me