Need to import data from a .csv file. Turn into time series and plot the time series as well as the linear regression

As you are knew to R, I would recommend a few resource on model with R:

Chapter on model in R4DS book

Chapter on model in Modern Dive book

You'll find in both book how to prepare data and how to model with R.

Regarding your issue here, it is kind of difficult to help you because we do not know what Wintemp is. It would help if you could adapt your example to provide a reprex. Thank you!