Before getting started, you will need to load two packages:
> install.packages("roxygen2")
> install.packages("devtools")
You now want to open File in RStudio and select New Project, which will put you at this point:
![](https://static.packt-cdn.com/products/9781789618006/graphics/assets/c2bcf8ba-219b-4c4d-92fd-005df4e29012.png)
Select a new directory as desired, and specify R Package, as shown in the following screenshot:
![](https://static.packt-cdn.com/products/9781789618006/graphics/assets/db732f43-6dd6-482c-8f0a-fe7df1edd107.png)
You will now name your package – I've innovatively called this one package – and select Create Project:
![](https://static.packt-cdn.com/products/9781789618006/graphics/assets/97cb655f-182c-4bc7-b8ed-8a10f6f3d7ee.png)
Go to your Files tab in RStudio and you should see several files populated like this:
![](https://static.packt-cdn.com/products/9781789618006/graphics/assets/79aaa9b3-3396-4b62-bb0e-a323c081dc9b.png)
Notice the folder called R. That is where we will put the R functions for our package. But first, click on Description and fill it out accordingly, and save it. Here is my version, which will be a function to code all missing values in a dataframe to zero:
![](https://static.packt-cdn.com/products/9781789618006/graphics/assets/2e91a5f8-c179-4d91-9b7c-383822596eeb.png)
I've left imports and suggests blank. This is where...