Porting Miranda&Fackler's CompEcon toolbox from Matlab to R