[Solved] Get access to the elements of a list in R [closed]

as.numeric(res$mean) Will do the job. As per your comment, so Forecast is the actual forecast and it is not always just the mean. Consider the following example using a data set taken from here library(forecast) births <- scan(“http://robjhyndman.com/tsdldata/data/nybirths.dat”) birthstimeseries <- ts(births, frequency=12, start=c(1946,1)) fit <- auto.arima(birthstimeseries) res <- forecast(fit, 12) plot(res) As you can see … Read more

[Solved] Forecasting basis the historical figures

You need to join those two dataframes to perform multiplication of two columns. merged_df = segmentallocation.merge(second,on=[‘year’,’month’],how=’left’,suffixes=[”,’_second’]) for c in interested_columns: merged_df[‘allocation’+str(c)] = merged_df[‘%of allocation’+str(c)] * merged_df[c] merged_df year month segment x y z k %of allocationx %of allocationy %of allocationz %of allocationk x_second y_second z_second k_second allocationx allocationy allocationz allocationk 0 2018 FEB A 2094663 … Read more