Run a line or run the whole document.
Run a line:
ctrl-enter
cmd-enter
Search all files in a directory:
ctrl-shift-f
cmd-shift-f
Ctrl + L
= clear commandsCtrl + 2
= move cursor to consoleCtrl + 1
= move cursor to script pagetab inside parentheses:
library(ggplot2)
ggplot()
try(source(""))
Tools –> install packages
You can fold sections of your code within an R script.
## fold this -------------------
### or this =======================
code–> insert section (with .R file) cmd-shift-i code–> insert chunk (with .Rmd file) cmd-alt-i
install.packages("addinslist")
View(mtcars)
Rstudio –> preferences –> Code –> debugging –> check all boxes
R studio can debug some of your code in real time, also has other debugging tools built in, such as browser()
.
Tools -> Shell
Currently in the “preview” release is built in profiling (determining the time each part of code takes to run)
Rdata
files, just rerun scriptsrm(list=ls())
mydata = read.table("../data/myfile.csv")