edit R functions