library(formatR)
## evaluate simple code as a character vector
tidy.eval(text = c("a<-1+1;a", "matrix(rnorm(10),5)"))
## evaluate a file
tidy.eval(source = file.path(system.file(package = "stats"), "demo", "nlm.R"),
keep.blank.line = TRUE)
Run the code above in your browser using DataLab