I'm trying to use arima with R to make a forecast querying data from SQL Server. How do you fix this? The error is:
Error in attr(x, "tsp") <- c(1, NROW(x), 1) :
invalid time series parameters specified
The original example used class(AirPassengers) https://www.youtube.com/watch?v=Y5T3ZEMZZKs Or does anyone have an example of R arima model using data from a sql database?
library(forecast)
conn = odbcConnect("Test")
wine <- sqlQuery(conn, "SELECT [Month]
,[Price]
FROM [dbo].[wine]")
# time series dataset:
class(wine)
start(dput(wine))
end(wine)
frequency(wine) # 12 months
sum(is.na(data)) # check for missing values; no missing values
I changed the dataset format. How do you get rid of the row id that's generated? It's not in the database table. That may be the problem?

Sample data:
wine <- structure(list("column 0" = c("Month", "Price", "Year"), "column 1" = c("1", "7.495", "2022"), "column 2" = c("2", "8.0393", "2022"), "column 3" = c("3", "7.6858", "2022"), "column 4" = c("4", "6.9845", "2022"), "column 5" = c("5", "6.7772", "2022"), "column 6" = c("6", "8.0757", "2022"), "column 7" = c("7", "6.5188", "2022"), "column 8" = c("8", "8.4937", "2022"), "column 9" = c("9", "7.388", "2022"), "column 10" = c("10", "6.7127", "2022"), "column 11" = c("11", "7.3094", "2022"), "column 12" = c("12", "6.2518", "2022"), "column 13" = c("1", "7.7443", "2023"), "column 14" = c("2", "6.8398", "2023"), "column 15" = c("3", "6.2435", "2023"), "column 16" = c("4", "6.3459", "2023"), "column 17" = c("5", "7.5883", "2023"), "column 18" = c("6", "7.1934", "2023"), "column 19" = c("7", "6.2049", "2023"), "column 20" = c("8", "6.6367", "2023"), "column 21" = c("9", "6.2941", "2023"), "column 22" = c("10", "7.292", "2023"), "column 23" = c("11", "7.1211", "2023"), "column 24" = c("12", "6.2587", "2023")), class = "data.frame", row.names = c(NA, -3L), columninfo = structure(list(name = c("Column 0", "Column 1", "Column 2", "Column 3", "Column 4", "Column 5", "Column 6", "Column 7", "Column 8", "Column 9", "Column 10", "Column 11", "Column 12", "Column 13", "Column 14", "Column 15", "Column 16", "Column 17", "Column 18", "Column 19", "Column 20", "Column 21", "Column 22", "Column 23", "Column 24"), type = c("12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12", "12")), class = "data.frame", row.names = c(NA, -25L)))