├── README0.md ├── TOC.md ├── README.md ├── scripts └── generate_TOC.R └── lists ├── Building_Rpackage.md └── Rpackage_preflight.md /README0.md: -------------------------------------------------------------------------------- 1 | # Data Analysis Procedures 2 | 3 | A place to hold check lists for data analysis activities. 4 | 5 | -------------------------------------------------------------------------------- /TOC.md: -------------------------------------------------------------------------------- 1 | # Table of Contents 2 | 1. [Building an R Package (starting off)](lists/Building_Rpackage.md) 3 | 2. [Building R Packages Pre-Flight Check List](lists/Rpackage_preflight.md) 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Data Analysis Procedures 2 | 3 | A place to hold check lists for data analysis activities. 4 | 5 | ## Table of Contents 6 | 7 | 1. [R Packages: Beginning Development](lists/Building_Rpackage.md) 8 | 2. [Building R Packages Pre-Flight Check List](lists/Rpackage_preflight.md) 9 | -------------------------------------------------------------------------------- /scripts/generate_TOC.R: -------------------------------------------------------------------------------- 1 | infile.path <- dir("lists", full.names = TRUE) 2 | 3 | con <- file("README.md", "w") 4 | start <- readLines("README0.md") 5 | writeLines(start, con) 6 | writeLines("## Table of Contents\n", con) 7 | 8 | titles <- sapply(infile.path, function(x) readLines(x, 1)) 9 | titles <- sub("^#+ +", "", titles) 10 | txt <- sprintf("%d. [%s](%s)", seq_along(infile.path), titles, infile.path) 11 | 12 | writeLines(txt, con) 13 | close(con) 14 | 15 | 16 | -------------------------------------------------------------------------------- /lists/Building_Rpackage.md: -------------------------------------------------------------------------------- 1 | # R Packages: Beginning Development 2 | 3 | 1. Run the pre-flight check list 4 | 18. Create new R script 5 | 11. Save R script in "R" sub-directory of package 6 | 12. Write R code/functions ---> save file 7 | 13. Write your documentation using Roxygen style comments in the R code file 8 | 19. Click "Install" 9 | 20. Test your package/code 10 | 21. Click on More ---> Check Package 11 | 22. Deal with any warnings, notes, or errors 12 | 22. Click More ---> Build Binary Package or Build Source Package 13 | -------------------------------------------------------------------------------- /lists/Rpackage_preflight.md: -------------------------------------------------------------------------------- 1 | # Building R Packages Pre-Flight Check List 2 | 3 | 1. Install latest version of R [from CRAN](https://cran.r-project.org) 4 | 2. Install latest version of RStudio Desktop [from Posit's web site](https://posit.co/download/rstudio-desktop/#download) 5 | 3. On WINDOWS: Install the latest RTools [from the R for Windows site](https://cran.r-project.org/bin/windows/Rtools/) 6 | 5. Open RStudio 7 | 6. Install `devtools` package (may take a few minutes) or update packages 8 | 4. Install `roxygen2` package 9 | 5. Click on Project ---> New Project… ---> New Directory 10 | 6. Click on "R Package using devtools" (you may need to scroll down in the menu) 11 | 7. Enter package name in the "Directory name:" field 12 | 9. Verify that project **subdirectory** path does not contain any spaces 13 | 8. Click "Create Project" 14 | 10. Click “Build” tab in environment browser 15 | 14. Click More ---> “Configure Build Tools…” 16 | 15. Check “Generate documentation with Roxygen” --> Click the "Configure..." button 17 | 16. Under "Automatically roxygenize when running:" verify that all 3 boxes are checked —> Click OK 18 | 17. Click OK in Project Build Tools Options 19 | 20 | --------------------------------------------------------------------------------