Intro to RStudio
-
Upload
egoodwintx -
Category
Data & Analytics
-
view
457 -
download
0
Transcript of Intro to RStudio
![Page 1: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/1.jpg)
Intro to RStudioHouston R Users Group
Ed Goodwin, CFA
![Page 2: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/2.jpg)
Why use an IDE?
Write Code
Compile Code
Run Code
Debug Code
Create Docs
Share Code
Version Control
Integrated Development Environment (IDE)
![Page 3: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/3.jpg)
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
![Page 4: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/4.jpg)
Versions of RStudioFeature 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 ✓
![Page 5: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/5.jpg)
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/
![Page 6: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/6.jpg)
RStudio IDE
Editor Panel
Console Panel
WorkspacePanel
PlotsPanel
![Page 7: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/7.jpg)
Integrated Documentation
![Page 8: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/8.jpg)
Help and Tutorialshttps://www.rstudio.com/resources/webinars/
![Page 9: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/9.jpg)
Keyboard Shortcuts
![Page 10: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/10.jpg)
Viewer• real time view of data
• filtering, sorting and search capability
![Page 11: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/11.jpg)
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"))
![Page 12: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/12.jpg)
RStudio ProjectsInitialize
• creates an .Rproj file to store settings • creates a .Rproj.user directory • Loads project into Rstudio into the toolbar
Project Options
![Page 13: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/13.jpg)
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
![Page 14: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/14.jpg)
Knitr and Markdownhttp://rmarkdown.rstudio.com/
![Page 15: Intro to RStudio](https://reader031.fdocuments.in/reader031/viewer/2022021420/5871f25c1a28ab5c348b5ca1/html5/thumbnails/15.jpg)
Version Control
https://support.rstudio.com/hc/en-us/articles/200532077-Version-Control-with-Git-and-SVN