adding sample code which can be used to invoke R and predict time series