user1059974
user1059974

Reputation: 31

Create script from console input in R

Instead of first creating a script in R and then executing it afterwards, is it possible to do it the other way around?

I.e. I would type some user input in the console, and afterwards have R compile all the user inputs from the console (without the resulting outputs), to a script for later user.

Upvotes: 3

Views: 271

Answers (1)

Richie Cotton
Richie Cotton

Reputation: 121077

Commands that you type into the console are stored in the history file (see ?savehistory). You can edit that to get your script.

Upvotes: 4

Related Questions