Do problem 1 in R.