Marinstatslectures

Like Us on FacebookFollow Us on TwitterSubscribe to Us on Youtube!Join Us on Google+

Scatterplots in R: (R Tutorial 2.6)

 

In this video you will learn how to make scatterplots in R to examine the relationship between two numeric variables and to modify the plot further to better depict your data.

Here, we will explain when it is appropriate to use scatterplot for our data and how to produce one in R using the "plot" command. In this tutorial, you will also learn to calculate pearson's correlation in R using "cor" command, determine which variable appears on which axes of a scatterplot in R, add a regression line to the plot using "abline" command, and to add a nonparametric smoother to the plot using "lines" and "smooth.spline" command. This video will also show you how to further modify your scatterplot by adding a title using the "main" argument, adding labels to the axes using the "xlab" or "ylab" arguments, rotating values of y-axis of using "las" argument, changing limits of x-axis or y-axis of the scatterplot using "xlim" or "ylim" argument, changing the size of the plotting characters using "cex" argument, changing the shape of the plotting character using "pch" argument, changing the color of the characters of your scatterplot using "col" argument, changing the colour of a regression line using "col" argument, changing the line type by "lty" argument and finally changing the width of the line using the "lwd" argument.

 

We recommend using the link below to download the dataset and practice on your own while watching this tutorial.

 

 You can access and download the dataset that was used in this tutorial here:

  Tab Delimited Dataset for R Tutorials Excel Dataset for R Tutorials

Previous Video in Series 2 R Tutorials Next Video in Series 2 R Tutorials

Back to Series 2 R Tutorials