I am somehow unable to edit my earlier post so I've posted the code here please
nf <- read.csv("F:/Project work/Publication/Under writing/Heat stress/nf_tas.csv", sep = ",", header = TRUE)
nf$date_mpi <- as.Date(as.character(nf$date_mpi))
nfu <- ggplot(data = nf, aes(x=nf$date_mpi, y=nf$mpi_nf))+
labs(title = "Annual temperature trends", x="Near-future projection", y="Temperature [°C]")+
scale_y_continuous(limits = c(24,31)) +
geom_line(aes(y=nf$mpi_nf, color='WRF-MPI-ESM MR'))+ geom_smooth(method = "lm", se=FALSE, formula = my.formula)+
geom_line(aes(y=nf$hadgem_nf, color='WRF-HadGEM2-ES'))+ geom_smooth(method = "lm", se=FALSE, formula = my.formula)+
geom_line(aes(y=nf$gfdl_nf, color='WRF-GFDL-ESM2M'))+ theme(legend.position = c(.1,.85))
#> Error in ggplot(data = nf, aes(x = nf$date_mpi, y = nf$mpi_nf)): could not find function "ggplot"
Created on 2020-03-22 by the reprex package (v0.2.1)