Project1 R codes and plots