%`) available, without explicitly requiring the loading of this secondary package. ## Miscellaneous Notes motivation for creating packages - Fritz Leisch, Kurt Hornik: [CRAN](https://cran.r-project.org/), package format - built on [CPAN](http://www.cpan.org/), [CTAN](https://www.ctan.org/?lang=en) - CRAN mirrors R source package contents - `DESCRIPTION` text file - folders: `R`, `man`, `data` - optional folders for added documentation: `inst`, `vignettes` + `inst` typically has sub-folder `doc` with `Rmd` files, etc. - optional files: `NAMESPACE` - `README.md` - Rstudio project file: `myname.Rproj` - `LICENSE` R installed package contents - takes source and moves to another place ## R package references - Karl Broman: [R Package Primer](http://kbroman.org/pkg_primer/) + [Package Examples](https://github.com/kbroman/pkg_primer/tree/gh-pages/example) - Hadley Wickham: [R Packages from O’Reilly](http://r-pkgs.had.co.nz/) - Hilary Parker: [R Package Tutorial](http://hilaryparker.com/2014/04/29/writing-an-r-package-from-scratch/) - Writing Documentation + Karl Broman: [Writing documentation with Roxygen2](http://kbroman.org/pkg_primer/pages/docs.html) + Josh Paulson: [Writing Package Documentation](https://support.rstudio.com/hc/en-us/articles/200532317-Writing-Package-Documentation) - CRAN: [Writing R Extensions](https://cran.r-project.org/doc/manuals/r-release/R-exts.html) - Jenny Bryan: [Writing your own R package](http://stat545-ubc.github.io/packages00_index.html) - [Writing R Extensions](http://cran.r-project.org/doc/manuals/R-exts.pdf) + [Creating R Packages: A Tutorial](http://blog.revolutionanalytics.com/2009/08/creating-r-packages-a-tutorial-draft.html) + [Freidrich Leisch (2008): Creating R Packages: A Tutorial](http://epub.ub.uni-muenchen.de/6175/) + [Brian Yandell's Demo Package](http://www.stat.wisc.edu/~yandell/mypackage) ([mydemo.R](http://www.stat.wisc.edu/~yandell/mypackage/inst/mynotes/mydemo.R) & [mypackage\_0.5-1.tar.gz](http://www.stat.wisc.edu/~yandell/mypackage_0.5-1.tar.gz) tarball) - Building R Packages for Windows + [Windows R Tools Official Page (Murdoch Sutherland)](http://www.murdoch-sutherland.com/Rtools/) + [Karl Broman's Windows Package Info](http://www.biostat.wisc.edu/~kbroman/Rintro/Rwinpack.html) + [Windows Toolset (R Admin Manual)](http://cran.r-project.org/doc/manuals/R-admin.html#The-Windows-toolset) + An alternative for your own packages is to submit the package to the http://win-builder.R-project.org site. It will build the package and run the package checks then send email to whoever is listed in the DESCRIPTION file as the maintainer with a link to the results. Especially for those of us who don't use Windows and find the steps required under Windows to be unnecessarily it is wonderful. If you have the fortunes package installed you should check ``` > fortune("installing") ```