Solutions to first to problems using R