Data Visualization

Using the ggplot2 package, we can create a scatter plot to visualize the relationship between height and weight.

rCopy code# Load ggplot2 package
library(ggplot2)

# Create a scatter plot of height vs weight
ggplot(data, aes(x = height, y = weight)) +
  geom_point(color = 'blue') +
  labs(title = "Scatter Plot of Height vs Weight",
       x = "Height (cm)",
       y = "Weight (kg)") +
  theme_minimal()

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *