Q:

how to plot the monthly average temperature over the entire length of the data set

I am a beginner of R.
The question is that you have this data set ready plot the monthly average temperature over the entire length of the data set. That is, on the x-axis plot the months (numbered 1, 2, 3…. 12, 13, 14,…), while on the y-axis plot the monthly averages.
I already have the data set like this 

my attempt is
plot(Temp$month,Temp$averagetemp)

the result is 
I wonder how to change the code.

A:

You can create a new variable that counts by months:
Temp$month_addative <- Temp$month + (Temp$year-min(Temp$year))*12
plot(Temp$month_additive,Temp$averagetemp)

Assuming 2003 is your lowest year, this will add 12 for every year past 2003 to the month number, creating a cumulative count of months.

