usefull function in R