Objective
To understand the fundamentals of R, explore a dataset, and create basic visualizations using
ggplot2.
Task Title
Exploratory Data Visualization on mtcars Dataset
Task Description
You are required to explore the built-in mtcars dataset in R and create basic visualizations to
understand relationships between variables. This task focuses on dataset understanding,
correct use of ggplot2, and interpretation of charts.
Instructions
1. Install and load the required package:
o ggplot2
2. Load the dataset:
o Use the built-in mtcars dataset
3. Perform basic exploration:
o Display first 6 rows of the dataset
o Check number of rows and columns
o Identify numerical and categorical variables
4. Create the following visualizations using ggplot2:
o Scatter plot: Weight (wt) vs Mileage (mpg)
o Bar chart: Count of cars by number of cylinders (cyl)
o Box plot: Mileage (mpg) grouped by cylinders (cyl)
5. Add the following to each plot:
o Proper title
o X-axis and Y-axis labels
o Appropriate color usage
6. Write interpretation:
o Minimum 2 observations for each plot in plain English