Update of the R codes