I have just started learning R for visualization .
I have installed and loaded ggplot2 package and the penguin dataset, but while trying to knit the R Markdown doc, I'm getting the below error:
Error in geom_point():
! Problem while computing aesthetics.
Error occurred in the 1st layer.
Caused by error:
! object 'flipper_length_mm' not found
This is the code:
ggplot(data = penguins) +
geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g, color = species)) +
labs(title = "Penguins:Body_mass vs Flipper_length", subtitle = "Sample of three penguins", caption = "Data collected by Dr. Kristen")+
annotate("text", x = 220, y = 3500, label = "Gentoos are the largest", color = "Blue", fontface = "italic", size = 4.5)
Can anyone please help me out? Thanks in advance!