library(readxl)
library(ggpubr)
## Loading required package: ggplot2
Replace Full Path with required path
D2 <- read_excel("A4Q2.xlsx")
Plot the graph
ggscatter(
D2,
x = "phone",
y = "sleep",
color = "#00A",
shape = "triangle",
add = "reg.line",
add.params = list(color = "red"), # Change ONLY the line color here
xlab = "Independent Variable (phone) /hours",
ylab = "Dependent Variable (sleep) /hours"
)