Using R for Principles of Econometrics