--- title: "4. Make a Package" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{4. Make a Package} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` ```{r setup, echo=FALSE} library(rUM) ``` ## Introduction Saving your data and analyses into an R package helps to create reproducible research. Someone who wants to reproduce your work can load a package to have access to your data and your paper(s). **`rUM`** can help you by creating a project that has all the files/directories needed for an R package including a vignette folder that contains the outline of a paper. ## How do I make a package project? All you need to do is add `vignette = TRUE` when you use the `make_project()` function. Once the project is created, run the **run_me.R** file. For example type: 1. `rUM::make_project("~/Desktop/my.example", "R", example = TRUE, vignette = TRUE)`. This creates a new project with all the files for a package in the current directory. The vignette includes an example table and figure and all the R Markdown syntax for adding hyperlinks to the table and figures. 2. After the new project is open, run the **RUN_ME_FIRST.R** file. The easiest way to do this is by typing `source("RUN_ME_FIRST.R")` into the RStudio IDE console and then pressing enter. If you are working in RStudio it will ask you if it can/should close windows for two deleted files. Say **Yes**. They are a couple temporary files that we used to set options the project.