Regression Line not showing
in
The Complete Data Visualization Course with Python, R, Tableau, and Excel
/
Regression Plot - R - How to Create a Regression Plot
Regression line is not showing and there's no error too. Please help.
1 answers ( 0 marked as helpful)
Hi Margaret,
thanks for reaching out! Your code is almost correct, but you forgot to add the last + between geom_point()
and geom_smooth(...)
that's why you're only seeing the scatter plot. It's really anoying when it's 99.99% correct but the last 0.01% gives you an error or doesn't output the correct visual. But with time and practice you'll be able to spot those errors when they happen a lot more easily, I guarantee it.
Keep up the good work and let me know if you encounter any other issues.
Best,
365 Eli