ABSTRACT

This chapter focuses on organizing and managing this growing collection of files—data, programs, numerical results, plots, or larger documents containing some of these other results—in a way that minimizes the effort and frustration involved in providing "minor variations" on old results. It covers how to manage the R installation itself: installing R, updating packages, and updating the R version. One of the particularly useful aspects of organizing R code as a the Comprehensive R Archive Network (CRAN)-compliant package is that R packages have specific documentation requirements. A useful directory structure contains subdirectories that group similar files together. A much simpler alternative that addresses the common code problem is to put all of the code files into a common directory, which can be retrieved using the source function as they are needed. R package documentation may also include references to relevant publications, or cross-references to related R functions.