My raw data is Date, A:z. I need to have each column/vector A:z as independent ts() time series. So I can run auto.armia and forecast functions on each Vector. I can read in successfully use seq_along to create seperate df A:Z in my global environment. My trouble now is looping through each df and turning them into time series, followed by looping through each with auto.armia, and forecast functions. End result should be a df with point forecast for each A:Z for time I specify (1 year or 5 years out) I want to set the forecast criteria for number of next periods as a variable.
structure(list(YEAR = c(2001, 2002, 2003, 2004, 2005, 2006),
A = c(0, 0, 0, 2003, 0, 0), B = c(0, 0, 0, 2004, 0, 0), C = c(0,
0, 0, 2005, 0, 0), D = c(0, 0, 0, 2006, 0, 0), E = c(0, 0,
0, 2007, 0, 0), F = c(0, 0, 0, 2008, 0, 0), G = c(0, 0, 0,
2009, 0, 2310593.63), H = c(0, 0, 0, 2010, 0, 949885.17),
I = c(0, 0, 0, 2011, 51939.35, 755167.32), J = c(0, 0, 0,
2012, 200485.83, 0), K = c(0, 0, 0, 2013, 340741.25, 0),
L = c(0, 0, 0, 2014, 692627.39, 0), M = c(0, 0, 0, 2015,
498738.38, 13228.06), N = c(0, 0, 0, 2016, 727855.33, 151441.77
), O = c(0, 0, 0, 2017, 1197076.02, 108188.58), P = c(0,
0, 0, 2018, 558267.98, 0), Q = c(0, 0, 0, 2019, 631624.18,
0), R = c(0, 0, 0, 2020, 1348869.22, 0), S = c(0, 0, 0, 2021,
1206861.95, 0), T = c(0, 0, 0, 2022, 0, 0), U = c(0, 0, 0,
2023, 0, 0), V = c(0, 0, 0, 2024, 0, 0), W = c("0", "0",
"0", "Grand Total", "7455086.88", "4288504.53"), X = c(0,
0, 0, 2011, 51939.35, 755167.32), Y = c(0, 0, 0, 2012, 200485.83,
0), Z = c(0, 0, 0, 2013, 340741.25, 0)), row.names = c(NA,
6L), class = "data.frame")