Reputation: 7999
User interface = Rstudio. Is there a short-cut key that will paste code from my console in Rstudio to a R Markdown file that I am developing in the workspace above the console?
In the picture above, I would like to move the read1_file <- read.table("C:/Users/perdue/Desktop/Adv. MicroEconometrics/HA 3/data/read1.sas", header= FALSE, skip = 1, sep = ",", dec=".")
code from the console into the R2b_Michael.Rmd
file using a short-cut key.
Upvotes: 3
Views: 5191
Reputation: 31452
You can easily copy lines of code from the history pane in Rstudio to either the console or to the editor.
First show the history pane. In the default layout it is a tab next to the environment tab in the top right pane.
Then highlight the commands you want to copy. You can click on a single command. Or shift-click selects a range or ctrl-click selects multiple commands.
Then shift-Enter copies the selected commands to the editor.
Alternatively, just pressing Enter copies the commands to the console
Upvotes: 4