Install the tidyverse package
If you have not done so already, please install the suite of packages called tidyverse using the code below.
install.packages("tidyverse")
install.packages("RColorBrewer")
Setting up the working directory
Next, let’s set up our working directory and bring in data:
-
Create new project called
Tidyverse.- Open RStudio
- Go to the
Filemenu and selectNew Project. - In the
New Projectwindow, chooseNew Directory. Then, chooseEmpty Project. Name your new directoryTidyverseand then “Create the project as subdirectory of:” the Desktop (or location of your choice). - Click on
Create Project. - After your project is completed, if the project does not automatically open in RStudio, then go to the
Filemenu, selectOpen Project, and chooseTidyverse.Rproj. - When RStudio opens, you will see three panels in the window.
- Go to the
Filemenu and selectNew File, and selectR Script. The RStudio interface should now look like the screenshot below.

-
Click on the “Files” tab to show the file directory, and click on the “New Folder” button.

Create the following folders:
- data
- results
- figures
-
Right-click here to download the file to your
datafolder (choose toSave Link AsorDownload Linked File As). You should see it indatafolder in the RStudio “Files” tab.
Click here to go to next lesson