I have a dataframe with yearly data from 2014 to 2018. I wish to expand this dataframe into monthly values and basically divide each variable's value by 12 as each month's value. Please note: There is no month column in my dataframe as of now. So, if there are 5 products, I have 5*5 rows and 5 columns :"year", "Product_ID", "Var1", "Var2" and "Var3" as the columns.
Eventually, I want 5*12 rows and 6 column with "month" inserted as well.
I have tried this code but it isnt working:
df_new$date <- NA
df_new <- complete(df,Product_ID, date = full_seq(2014,1))
Any suggestions?