library(tidyverse)Let us create a data set and store it in a data frame.
set.seed(42) x <- rnorm(100, mean=5, sd=20) y <- x + rnorm(100, mean=1, sd=20) df <- data.frame(x=x, y=y)Let us use the above dataframe to make scatter plot with ggplot2 in R. In ggplot2, geom_point() function helps us make scatter plot. After defining the aesthetics for ggpot2, we can add geom_point() to make scatter plot.
df %>% ggplot(aes(x=x,y=y)) + geom_point()Here we have the simple scatter plot that we just made.
![](https://datavizpyr.com/wp-content/uploads/2019/12/simple_scatter_plot_R_ggplot2-1.png)