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
File
menu and selectNew Project
. - In the
New Project
window, chooseNew Directory
. Then, chooseEmpty Project
. Name your new directoryTidyverse
and 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
File
menu, selectOpen Project
, and chooseTidyverse.Rproj
. - When RStudio opens, you will see three panels in the window.
- Go to the
File
menu 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
data
folder (choose toSave Link As
orDownload Linked File As
). You should see it indata
folder in the RStudio “Files” tab.
Click here to go to next lesson