run R code from terminal