Если этот скрипт 'R' написан на python, вы можете отредактировать функцию так, чтобы она возвращала прогноз в конце ее выполнения, а затем, когда вы вызываете функцию в основном скрипте, вы можете назначить ей переменную, поэтомунапример:
Сценарий R:
def dummy_forecast(s, e):
#do calculations etc
return forecast #or whatever you have called the data stored in here.
Основной сценарий:
#as long as script R is in the same folder as the main script, you can just do:
import R
#if it is not, this is what you want to do:
import sys
sys.path.insert(0, r'C:\directory\of\script\r')
import R
#then once you have imported R, you can do the following
start = 'blah blah'
end = 'blah blah'
forecast = R.dummy_forecast(start, end)
print forecast