some useful script for R programming