revolution r and dphs cluster statistical computing 4/9/14
TRANSCRIPT
![Page 1: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/1.jpg)
Revolution R andDPHS Cluster
Statistical Computing4/9/14
![Page 2: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/2.jpg)
Revolution R
![Page 3: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/3.jpg)
What is it?
Back End
Front End
![Page 4: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/4.jpg)
What is it?
![Page 5: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/5.jpg)
Single Versus Multi Threading
R uses a single thread
Revolution R uses multiple
threads
![Page 6: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/6.jpg)
The Standard R Interface
![Page 7: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/7.jpg)
Revolution R Environment
Script(s)
Console
![Page 8: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/8.jpg)
Revolution R Environment
Running R Script
![Page 9: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/9.jpg)
Revolution R Environment
Running Line or Section
![Page 10: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/10.jpg)
Revolution R Environment
Installed/ Loaded
Packages
Available Objects
Object Details
![Page 11: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/11.jpg)
Revolution R Environment
Project Manager
![Page 12: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/12.jpg)
Project Manager• Solutions
o Corresponds to one R workspace/working directoryo Storage for common files for projects
• Projecto Independent set of R scripts
• Scripts and Documentationo Single Files that can be sourced, run, viewed, etc.
![Page 13: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/13.jpg)
Scripts• R syntax checking and parenthesis highlighting• IntelliSense word completion
o CTRL+Space
• Setting Breakpointso Breakpoints tell the R debugger where to stop execution, so that you can examine
the state of the computation at that point. o Place the cursor anywhere on the desired line and press F9. o Click the gray bar to the left of the desired line.o Repeat the procedure to delete the breakpoint.
• Run all or part of a script in the command window• Set Bookmarks
o Bookmarks make it easy to move from place to place within a large script, and also to move from script to script. You set bookmarks using any of the following methods:
o Place the cursor anywhere on the desired line and press CTRL-K, CTRL-K. o Repeat the procedure to delete the bookmark.
• Automatically comment out sections
![Page 14: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/14.jpg)
Snippets• A predefined template for common R idioms
o Insert snippet, then fill in the blankso Right Click ->Insert Snippet
• Code Snippet Managero Create and Share your own snippets (Using XML and Visual Studio)o Allows you to automate programming frequent taskso NOT the same as a SAS macro
• Standardize analyses and enforce coding standards
![Page 15: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/15.jpg)
Snippets in Revolution R
![Page 16: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/16.jpg)
Snippets in Revolution R
![Page 17: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/17.jpg)
Snippets in Revolution R
![Page 18: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/18.jpg)
Snippets in Revolution R
![Page 19: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/19.jpg)
Debugging• Revolution R has a debugging feature
o Helpful to identify reasons code won’t runo Excellent way to check more complicated code
• Complex analyses• Simulation Studies
o Also extremely helpful if you are writing an R package
![Page 20: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/20.jpg)
Debugging in Revolution R
Debugging
![Page 21: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/21.jpg)
Debugging in Revolution R
Debugging
![Page 22: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/22.jpg)
Available Objects• Inspect objects in current environment
• List installed and loaded packages
• Browse objects in packages
• Inspect and edit data
• Plot data objects
![Page 23: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/23.jpg)
Other• Interactive Debug Feature
o Debug vs. Release mode: control whether breakpoints are usedo Step Execution
![Page 24: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/24.jpg)
Shortcut Action
Ctrl-A Select All
Ctrl-B New Breakpoint
Ctrl-C Copy
Ctrl-F Find
Ctrl-L Cut current line or selection to clipboard
Ctrl-N New File
Ctrl-O Open File
Ctrl-P Print
Ctrl+R Ctrl+R, Ctrl+W - View white space
Ctrl+R, Ctrl+S Run Selection
Ctrl+R, Ctrl+C Run Current Script
Ctrl-T Transpose characters
Ctrl-U Changes selected text to lowercase
Ctrl-V Paste
Ctrl-WSelects the word containing the cursor or to the right of the cursor
Ctrl-X Cut
Ctrl-Y Redo
Ctrl-Z Undo
![Page 25: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/25.jpg)
![Page 26: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/26.jpg)
DPHS ClusterThis only works for Revolution R Enterprise
![Page 27: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/27.jpg)
Accessing The ClusterPHSCLUSTER <- RxHpcServer( #Location of revolution R Enterprise on each node revoPath="C:\\Revolution\\R-Enterprise-Node-6.1\\R- 2.14.2\\bin\\x64", #Location of big Data files on each node dataPath="c:\\data", #User Directory for read/write shareDir="\\Clustershare\\cne2" , )
#Sets Compute Context to the ClusterrxOptions( computeContext = PHSCLUSTER )#Sets Compute Context to the Local MachinerxOptions( computeContext = RxLocalSeq())
![Page 28: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/28.jpg)
Accessing The ClusterPHSCLUSTER <- RxHpcServer( #Location of revolution R Enterprise on each node revoPath="C:\\Revolution\\R-Enterprise-Node-6.1\\R- 2.14.2\\bin\\x64", #Location of big Data files on each node dataPath="c:\\data", #User Directory for read/write shareDir="\\Clustershare\\cne2" , )
#Sets Compute Context to the ClusterrxOptions( computeContext = PHSCLUSTER )#Sets Compute Context to the Local MachinerxOptions( computeContext = RxLocalSeq())
![Page 29: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/29.jpg)
Accessing The ClusterPHSCLUSTER <- RxHpcServer( #Location of revolution R Enterprise on each node revoPath="C:\\Revolution\\R-Enterprise-Node-6.1\\R- 2.14.2\\bin\\x64", #Location of big Data files on each node dataPath="c:\\data", #User Directory for read/write shareDir="\\Clustershare\\cne2" , )
#Sets Compute Context to the ClusterrxOptions( computeContext = PHSCLUSTER )#Sets Compute Context to the Local MachinerxOptions( computeContext = RxLocalSeq())
![Page 30: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/30.jpg)
Accessing The ClusterPHSCLUSTER <- RxHpcServer( #Location of revolution R Enterprise on each node revoPath="C:\\Revolution\\R-Enterprise-Node-6.1\\R- 2.14.2\\bin\\x64", #Location of big Data files on each node dataPath="c:\\data", #User Directory for read/write shareDir="\\Clustershare\\cne2" , )
#Sets Compute Context to the ClusterrxOptions( computeContext = PHSCLUSTER )#Sets Compute Context to the Local MachinerxOptions( computeContext = RxLocalSeq())
![Page 31: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/31.jpg)
Accessing The ClusterPHSCLUSTER <- RxHpcServer( #Location of revolution R Enterprise on each node revoPath="C:\\Revolution\\R-Enterprise-Node-6.1\\R- 2.14.2\\bin\\x64", #Location of big Data files on each node dataPath="c:\\data", #User Directory for read/write shareDir="\\Clustershare\\cne2" , )
#Sets Compute Context to the ClusterrxOptions( computeContext = PHSCLUSTER )#Sets Compute Context to the Local MachinerxOptions( computeContext = RxLocalSeq())
![Page 32: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/32.jpg)
Accessing The ClusterPHSCLUSTER <- RxHpcServer( #Location of revolution R Enterprise on each node revoPath="C:\\Revolution\\R-Enterprise-Node-6.1\\R- 2.14.2\\bin\\x64", #Location of big Data files on each node dataPath="c:\\data", #User Directory for read/write shareDir="\\Clustershare\\cne2" , )
#Sets Compute Context to the ClusterrxOptions( computeContext = PHSCLUSTER )#Sets Compute Context to the Local MachinerxOptions( computeContext = RxLocalSeq())
![Page 33: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/33.jpg)
Accessing The ClusterPHSCLUSTER <- RxHpcServer( #Location of revolution R Enterprise on each node revoPath="C:\\Revolution\\R-Enterprise-Node-6.1\\R- 2.14.2\\bin\\x64", #Location of big Data files on each node dataPath="c:\\data", #User Directory for read/write shareDir="\\Clustershare\\cne2" , )
#Sets Compute Context to the ClusterrxOptions( computeContext = PHSCLUSTER )#Sets Compute Context to the Local MachinerxOptions( computeContext = RxLocalSeq())
![Page 34: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/34.jpg)
Setting a Progress Timer
#Create a Progress Bar Objectpb <- winProgressBar(title = "progress bar", min = 0, max = total, width = 300)
for(i in 1:total){ data1<-rnorm(n=100,mean=0,sd=1) #Update the Progress Bar with the Current Unit setWinProgressBar(pb, i, title=paste( round(i/total*100, 0), "% done")) #Pause the system in order to update the progress bar (may not be necessary) #Sys.sleep(0.1)}close(pb)
![Page 35: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/35.jpg)
Other Features
![Page 36: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/36.jpg)
RevoScaleR Package
![Page 37: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/37.jpg)
RevoScaleR Package
![Page 38: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/38.jpg)
RevoScaleR Package
![Page 39: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/39.jpg)
DeployR
![Page 40: Revolution R and DPHS Cluster Statistical Computing 4/9/14](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649e355503460f94b240d3/html5/thumbnails/40.jpg)
DeployR