Added directory path in R_meth_functions.R and fixed some bugs