14 Where to go from here

Practice makes perfection. Use what you learned as much as possible in your research and work.

14.1 Noticeable features not covered

R is getting more powerful all the time. There are many exciting features and packages that we have not covered and many more are emerging. Below are a few features I think are worth mentioning:

14.2 Automate testing your code

It is always a good idea to test your code with simple inputs to make sure it work correctly before adding complexity and deploying it for actual work (see best practices for data science 5). There are ways to automate the tests, so you will not forget to run the tests. Hadley Wickham writes about testing for R packages and testthat is a R package specifically to make testing. And if you use GitHub or other popular public version control website, it is possible to use Travis-CI to do “continuous integration” tests for your code. Julia Silge has a nice tutorial for beginners.

14.3 Automate your workflow

If you are seasoned programmer and are familiar with the make toolchain, you can use it to automate your workflow too. Professor Jenny Bryan provides a tutorial for her STAT 545 class.

A more research-oriented solution is to use the remake package:

The idea here is to re-imagine a set of ideas from make but built for R. Rather than having a series of calls to different instances of R (as happens if you run make on R scripts), the idea is to define pieces of a pipeline within an R session. Rather than being language agnostic (like make must be), remake is unapologetically R focussed.

remake is still under heavy development and is not yet available on CRAN. You will have to install it from github:

library(devtools)
install_github("richfitz/remake")

14.4 Develop interactive apps with Shiny

Shiny allows you to develop interactive apps that run on top of R. Again Prof Jenny Bryan has a nice tutorial for getting started with Shiny.

14.5 Where to find help

  1. Help documents;
  2. Package vignett and manual;
  3. R cookbook;
  4. Stack Overflow and Cross Validated, A Q&A community for programming and statistics;
  5. Google is your friend;
  6. Ask a person who may know.

Merali, Zeeya. 2010. “Computational Science: ...Error.” Nature News 467 (7317): 775–77. doi:10.1038/467775a.

University Transportation Research Center. 2014. “Ground Transportation Technology Symposium: Big Data and Innovative Solutions for Safe, Efficient and Sustainable Mobility.” In. New York, NY.

Wilson, Greg, D. A. Aruliah, C. Titus Brown, Neil P. Chue Hong, Matt Davis, Richard T. Guy, Steven H. D. Haddock, et al. 2014. “Best Practices for Scientific Computing.” PLOS Biology 12 (1): e1001745. doi:10.1371/journal.pbio.1001745.