Basic Plot with ggplot() and aes() in R
📖 Scenario: You are a data analyst who wants to visualize the relationship between two variables in a small dataset. You will create a simple scatter plot using ggplot() and aes() from the ggplot2 package in R.
🎯 Goal: Build a scatter plot using ggplot() and aes() to map variables to the x and y axes.
📋 What You'll Learn
Create a data frame called
data with two numeric columns: height and weight with exact valuesCreate a
ggplot object using ggplot() with data as the data sourceUse
aes() inside ggplot() to map height to the x-axis and weight to the y-axisAdd
geom_point() to display the pointsPrint the plot object to display the scatter plot
💡 Why This Matters
🌍 Real World
Creating visualizations helps understand data patterns and relationships quickly, which is useful in reports and presentations.
💼 Career
Data analysts and scientists use ggplot2 to create clear and attractive charts to communicate insights effectively.
Progress0 / 4 steps