added r code and data set