2. Why use an IDE?
Write
Code
Compile
Code
Run
Code
Debug
Code
Create
Docs
Share
Code
Version
Control
Integrated Development Environment (IDE)
3. Why use RStudio?
• built for R from the ground up (syntax highlighting, autocompletion, formatting)
• integrates R packages, documentation, debugging and viewing tools
• enforces best practices (documentation, version control, unit testing)
• community support
4. Versions of RStudio
Feature RStudio Desktop RStudio Server RStudio Server Pro
License AGPL AGPL RStudio License
Price Free/$995 Free $9,995/server/yr
Full IDE ✓ ✓ ✓
Remote Access ✓ ✓
Load Balancing ✓
Shiny Integration ✓ ✓ ✓
Group Admin Tools ✓
Security Tools ✓
Monitoring Tools ✓
5. Preview Version of
RStudio
• Customizable keybindings
• Pane zooming
• Multiple source windows
• Registering RStudio add-ins (RStudio ecosystem)
• Markdown improvements
https://www.rstudio.com/products/rstudio/download/preview/
10. Viewer
• real time view of data
• filtering, sorting and search capability
11. Dygraphs
• R interface to dygraphs
JavaScript library
• Dygraphs package
independent of RStudio, but
supported in the Plot panel
• install.packages(“dygraphs”)
• supports zooming and panning
of time series
dygraph(pigs, main = "Monthly Pigs Slaughtered - Victoria") %>%
dyRangeSelector(dateWindow = c("1980-01-01", "1996-01-01"))
12. RStudio Projects
Initialize
• creates an .Rproj file to store settings
• creates a .Rproj.user directory
• Loads project into Rstudio into the toolbar
Project Options
13. Debugging
• Breakpoints (Shft+F9)
• R functions
• browser()
• debugonce()
• Environment Pane
• Traceback (Callstack)
• Console
• step into function (Shft+F4)
• finish function (Shft+F6)
• continue running (Shft+F5)
• stop debugging (Shft+F8)
Resources
• “Intro to Debugging in R
https://vimeo.com/99375765
• Advanced R chapter on Debugging
http://adv-r.had.co.nz/Exceptions-Debugging.html