Exercise 1: Importing Data from CSV
You are working with the following CSV file containing employee information:
Employee ID,Full Name,Department,Salary,Years of Experience
1,John Doe,HR,50000,5
2,Jane Smith,Engineering,N/A,8
3,Michael Johnson,Marketing,55000,6
4,Susan Lee,HR,52000,4
5,David Kim,Engineering,65000,7
6,Amy Brown,Marketing,57000,5
- Use the
read_csv()
function to import this data into R.
- For illustration, you can use the literal data (hint: use
I()
) to import the csv text.
- Clean the data by replacing any missing salary values with NA.
- Rename the columns to use snake case (employee_id, full_name, department, salary, years_of_experience).