Reputation: 77
I am training on diamonds set, I don't thing it is impossible to be runned by R
ggplot(data = diamonds, mapping = aes(x = carat, y = price)) +
geom_point()+
geom_smooth(data = diamonds[diamonds$carat<3.1], method = 'lm', color ='red')
any suggestions? Thank you in advance
Upvotes: 1
Views: 37
Reputation: 39595
Try this:
#Code
ggplot(data = diamonds, mapping = aes(x = carat, y = price)) +
geom_point()+
geom_smooth(data = diamonds[diamonds$carat<3.1,], method = 'lm', color ='red')
Output:
Upvotes: 3