Call R script from elastic aggregation

Is it possible to call R script from aggregation? Same as the built in moving avarage, but using my own script?

Thanks

No. There are R clients that let you call Elasticsearch from R, but not the
other way around.