Renamed, reformatted

Still not working, error at line 112
Error in `[.xts`(R, i + 1) : subscript out of bounds