add some R codes