Practical Objectives
- Set the working directory properly
- Load spreadsheet data into R.
- Calculate frequently used summary statistics in R.
- Subset and investigate data stored in Data Frames.
Expected Outcomes
- Either pdf or word document which include all answers of each question.
Task 1: The Working Directory
First and foremost, please open the R studio in your computer
- if you are going to use your own laptop, you should install “R” and “R studio” both.
Setting up the working directory in R is important for the following reasons:
- File Access and Management
- R relies on the working directory to locate files you want to import and export (like an address for each file)
- Saving Your Outputs
- efficient file saving: after setting the directory up, you ensure all generated outputs are saved where they belong
- How to set the working directory
setwd(" C:/path/to/your/folder")
## you can get the path of folder with the right click
## or at first you can check your current working directory using:
getwd()
# this command returns the path to the current directory
or you can use R studio environment to set up the working directory
