How to make a scatter plot in R with Regression Line (ggplot2)

67,208
0
Published 2018-03-23
This is a quick R tutorial on creating a scatter plot in R with a regression line fitted to the data in ggplot2.

If you found this video helpful, make sure to like it so others can find it!
Make sure to subscribe for the best R content on the planet!

All Comments (21)
  • Thank you! I always found ggplot super confusing but this video really cleared it up for me :)
  • @BlackW0lfie
    You, sir. You have saved my life. I might actually have some decent figures now to put on my coursework
  • @drake-om7ir
    this video is so helpful thanks a bunch 🥰
  • @MrAttackdawgs
    How can I get the r squared value to show up on the plot?
  • @sdgarcia34
    These are all great and very informative videos! Thank you very much for posting them. Still i am straggling a bit, I would like to check the correlation of let say 8000 genes in 10 different patients that I organized from less sick to more sick (let say percentage of neuronal loss). There is any way I can get the correlation of the expression of these genes with the sickness of the patient looking at the r? (ex. 0.99 would be a gene that correlate better with a worse pathology, right?) if so, Can I check all the r for each gene using R?
  • Thank you for this. I'm wondering how I can keep the colors for different classes on the scatter plot, but just have one regression line fitted to all the data (not one for each class)
  • @Jay19876
    Is there an easy way to get the equation of the regression line as well as the R^2 value projected onto the plot?
  • Hi, I understand this video came out a long ago, Just wondering how to add state acronyms on the scatter plot so that states name all appear next to dot point. Thanks
  • Hello , thank you for this video , is there a way to put directly the annotation on the plot ? thank you
  • Thank you for the video! Do you know how to add the regression line equation and R^2 on graph?
  • how to create multiple scatter plot between AGB Independent and NDVI, LAI, SAVA dependent variable with r-square?
  • I like the way ask to hit like to make a few quid .....appreciate saying it straight out !!