added some more rccp

exercises 2 and 3 from hadley’s guide
http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-attributes.pd
f