Added R codes and plots