Sample R codes