Code:

```
mydata <- read_excel(file.choose())
mydata<- ts(mydata$Spend, start = c(2017, 7), frequency = 12)
```

I do

Code:

`mydatatr<- ts(mydata$Spend, start = c(2017, 7), end = c(2021,9), frequency = 12)`

Error in mydata$Spend : $ operator is invalid for atomic vectors

It is the same data set, this makes no sense.