MACHINE LEARNING RECIPES
DATA CLEANING PYTHON
DATA MUNGING
PANDAS CHEATSHEET
ALL TAGS
# How to plot scatter plot using plot function in R?

# How to plot scatter plot using plot function in R?

This recipe helps you plot scatter plot using plot function in R

How to plot scatter plot using plot function in R? Scatter plots are graphs that represent a relation between an independent variable (x) and a dependent variable (y). The plot represents data on a 2 dimensional plane, where dependent variable (y) is plotted on the Y-axis and an independent variable (x) is plotted on the X-axis. Scatter plots are used to explain the correlation between the two variables. There are mainly 3 cases in scatter plot correlation – - Positive correlation - Negative correlation - No correlation Scatter plots help us understand and visualize the data properly. This recipe demonstrates an example of scatter plots.

```
x <- c(2,3,8,9,4,6,9,7,6,9)
y <- c(3,9,5,6,8,6,5,8,9,3)
```

Syntax for scatter plot - plot(x, y, main, xlab, ylab, xlim, ylim, axes) where, x - independent data points, y -independent data points, main - title of the correlation plot, xlab - title of the x axis, ylab - title of the y axis, xlim - limits for x axis data points, ylim - limits for y axis data points, axes - whether both the axes should be drawn on the plot.

```
plot(x,y,main="Correlation between x and y",xlab="x data points", ylab= "y data points", xlim=c(1,10),ylim=c(1,10))
```

```
corelation <- cor(x,y)
corelation
# the scatter plot shows a negative correlation between the two variables.
```

"Correlation between the two variables is :" -0.259788098433717

Data Science Project in R-Predict the sales for each department using historical markdown data from the Walmart dataset containing data of 45 Walmart stores.

PySpark Project-Get a handle on using Python with Spark through this hands-on data processing spark python tutorial.

In this ML Project, you will use the Avocado dataset to build a machine learning model to predict the average price of avocado which is continuous in nature based on region and varieties of avocado.

Music Recommendation Project using Machine Learning - Use the KKBox dataset to predict the chances of a user listening to a song again after their very first noticeable listening event.

In this deep learning project, you will build a convolutional neural network using MNIST dataset for handwritten digit recognition.

In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.

In this data science project, you will work with German credit dataset using classification techniques like Decision Tree, Neural Networks etc to classify loan applications using R.

In this Kmeans clustering machine learning project, you will perform topic modelling in order to group customer reviews based on recurring patterns.

In this data science project, we will predict the credit card fraud in the transactional dataset using some of the predictive models.

In this human activity recognition project, we use multiclass classification machine learning techniques to analyse fitness dataset from a smartphone tracker.