Scatter plots (geom_point)
📖 Scenario: You are a data analyst working with a small dataset of car speeds and stopping distances. You want to visualize the relationship between speed and distance using a scatter plot.
🎯 Goal: Create a scatter plot using geom_point in ggplot2 to show how car speed relates to stopping distance.
📋 What You'll Learn
Create a data frame called
cars_data with columns speed and dist using the exact values provided.Create a variable called
plot_title with the exact string 'Speed vs Stopping Distance'.Use
ggplot with geom_point to create a scatter plot of speed on the x-axis and dist on the y-axis.Add the title stored in
plot_title to the plot using ggtitle().Print the plot object to display the scatter plot.
💡 Why This Matters
🌍 Real World
Scatter plots help visualize relationships between two numeric variables, such as speed and stopping distance in cars.
💼 Career
Data analysts and scientists use scatter plots to explore data patterns and communicate findings clearly.
Progress0 / 4 steps