hadley / r4ds

R for data science: a book
http://r4ds.hadley.nz
Other
4.59k stars 4.22k forks source link

Exercise in 1.5.5 - linewidth as undefined parameter? #1614

Closed mreinaroca closed 10 months ago

mreinaroca commented 10 months ago

Hi there! I'm following all of the second edition of the book and in Exercise 3 of the 1.5.5. section is says: "In the scatterplot of hwy vs. displ, what happens if you map a third variable to linewidth?". However, there is no parameter/aesthetic called linewidth not in the documentation nor as a factor in the dataset. When included in the code, R just ignores the parameter. So I would assume this is an error? Can someone correct me or fix this, please? This caused me a little confusion haha.

image

Thanks, -MR

mine-cetinkaya-rundel commented 10 months ago

Thanks for the feedback. This is sort of the point of the exercise, that if you map a variable to an aesthetic that is not relevant, it's ignored.