I am trying to model the overall trend of the data set globtemp from the astsa R package with a polynomial: however, I am having problems creating the liner model.

library(astsa)

library(xts)

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

as.Date, as.Date.numeric

g.temp=as.matrix(globtemp)

plot(time~temperature, ylab="Temperature", main="Global Temperature Model")

Error in eval(predvars, data, env): object 'temperature' not found

Created on 2021-10-27 by the reprex package (v2.0.1)

localhost:14261/session/satin-urial_reprex_preview.html