Reputation: 434
The following script works perfectly well. Still, I would like to know if it possible to source directly the vector x.
x <- c("print (\"Hallo world\")", "print (\"(Just an example)\")")
temporary_file <- tempfile()
write(x, file = temporary_file )
source(temporary_file)
Upvotes: 0
Views: 95
Reputation: 35314
x <- c("print (\"Hallo world\")", "print (\"(Just an example)\")");
eval(parse(text=x));
## [1] "Hallo world"
## [1] "(Just an example)"
Upvotes: 3