Revolution R and DPHS Cluster Statistical Computing 4914

  • Slides: 40
Download presentation
Revolution R and DPHS Cluster Statistical Computing 4/9/14

Revolution R and DPHS Cluster Statistical Computing 4/9/14

Revolution R

Revolution R

What is it? Front End Back End

What is it? Front End Back End

What is it?

What is it?

Single Versus Multi Threading R uses a single thread Revolution R uses multiple threads

Single Versus Multi Threading R uses a single thread Revolution R uses multiple threads

The Standard R Interface

The Standard R Interface

Revolution R Environment Script(s) Console

Revolution R Environment Script(s) Console

Revolution R Environment Running R Script

Revolution R Environment Running R Script

Revolution R Environment Running Line or Section

Revolution R Environment Running Line or Section

Revolution R Environment Available Objects Installed/ Loaded Packages Object Details

Revolution R Environment Available Objects Installed/ Loaded Packages Object Details

Revolution R Environment Project Manager

Revolution R Environment Project Manager

Project Manager • Solutions o Corresponds to one R workspace/working directory o Storage for

Project Manager • Solutions o Corresponds to one R workspace/working directory o Storage for common files for projects • Project o Independent set of R scripts • Scripts and Documentation o Single Files that can be sourced, run, viewed, etc.

Scripts • R syntax checking and parenthesis highlighting • Intelli. Sense word completion o

Scripts • R syntax checking and parenthesis highlighting • Intelli. Sense word completion o CTRL+Space • Setting Breakpoints o 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 F 9. 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

Snippets • A predefined template for common R idioms o Insert snippet, then fill

Snippets • A predefined template for common R idioms o Insert snippet, then fill in the blanks o Right Click ->Insert Snippet • Code Snippet Manager o Create and Share your own snippets (Using XML and Visual Studio) o Allows you to automate programming frequent tasks o NOT the same as a SAS macro • Standardize analyses and enforce coding standards

Snippets in Revolution R

Snippets in Revolution R

Snippets in Revolution R

Snippets in Revolution R

Snippets in Revolution R

Snippets in Revolution R

Snippets in Revolution R

Snippets in Revolution R

Debugging • Revolution R has a debugging feature o Helpful to identify reasons code

Debugging • Revolution R has a debugging feature o Helpful to identify reasons code won’t run o Excellent way to check more complicated code • Complex analyses • Simulation Studies o Also extremely helpful if you are writing an R package

Debugging in Revolution R Debugging

Debugging in Revolution R Debugging

Debugging in Revolution R Debugging

Debugging in Revolution R Debugging

Available Objects • Inspect objects in current environment • List installed and loaded packages

Available Objects • Inspect objects in current environment • List installed and loaded packages • Browse objects in packages • Inspect and edit data • Plot data objects

Other • Interactive Debug Feature o Debug vs. Release mode: control whether breakpoints are

Other • Interactive Debug Feature o Debug vs. Release mode: control whether breakpoints are used o Step Execution

Shortcut Action Ctrl-A Select All Ctrl-B New Breakpoint Ctrl-C Copy Ctrl-F Find Ctrl-L Cut

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+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-W Selects the word containing the cursor or to the right of the cursor Ctrl-X Cut Ctrl-Y Redo Ctrl-Z Undo

DPHS Cluster This only works for Revolution R Enterprise

DPHS Cluster This only works for Revolution R Enterprise

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on each node revo. Path="C: \Revolution\R-Enterprise-Node-6. 1\R 2. 14. 2\bin\x 64", #Location of big Data files on each node data. Path="c: \data", #User Directory for read/write share. Dir="\Clustershare\cne 2" , ) #Sets Compute Context to the Cluster rx. Options( compute. Context = PHSCLUSTER ) #Sets Compute Context to the Local Machine rx. Options( compute. Context = Rx. Local. Seq())

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on each node revo. Path="C: \Revolution\R-Enterprise-Node-6. 1\R 2. 14. 2\bin\x 64", #Location of big Data files on each node data. Path="c: \data", #User Directory for read/write share. Dir="\Clustershare\cne 2" , ) #Sets Compute Context to the Cluster rx. Options( compute. Context = PHSCLUSTER ) #Sets Compute Context to the Local Machine rx. Options( compute. Context = Rx. Local. Seq())

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on each node revo. Path="C: \Revolution\R-Enterprise-Node-6. 1\R 2. 14. 2\bin\x 64", #Location of big Data files on each node data. Path="c: \data", #User Directory for read/write share. Dir="\Clustershare\cne 2" , ) #Sets Compute Context to the Cluster rx. Options( compute. Context = PHSCLUSTER ) #Sets Compute Context to the Local Machine rx. Options( compute. Context = Rx. Local. Seq())

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on each node revo. Path="C: \Revolution\R-Enterprise-Node-6. 1\R 2. 14. 2\bin\x 64", #Location of big Data files on each node data. Path="c: \data", #User Directory for read/write share. Dir="\Clustershare\cne 2" , ) #Sets Compute Context to the Cluster rx. Options( compute. Context = PHSCLUSTER ) #Sets Compute Context to the Local Machine rx. Options( compute. Context = Rx. Local. Seq())

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on each node revo. Path="C: \Revolution\R-Enterprise-Node-6. 1\R 2. 14. 2\bin\x 64", #Location of big Data files on each node data. Path="c: \data", #User Directory for read/write share. Dir="\Clustershare\cne 2" , ) #Sets Compute Context to the Cluster rx. Options( compute. Context = PHSCLUSTER ) #Sets Compute Context to the Local Machine rx. Options( compute. Context = Rx. Local. Seq())

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on each node revo. Path="C: \Revolution\R-Enterprise-Node-6. 1\R 2. 14. 2\bin\x 64", #Location of big Data files on each node data. Path="c: \data", #User Directory for read/write share. Dir="\Clustershare\cne 2" , ) #Sets Compute Context to the Cluster rx. Options( compute. Context = PHSCLUSTER ) #Sets Compute Context to the Local Machine rx. Options( compute. Context = Rx. Local. Seq())

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on

Accessing The Cluster PHSCLUSTER <- Rx. Hpc. Server( #Location of revolution R Enterprise on each node revo. Path="C: \Revolution\R-Enterprise-Node-6. 1\R 2. 14. 2\bin\x 64", #Location of big Data files on each node data. Path="c: \data", #User Directory for read/write share. Dir="\Clustershare\cne 2" , ) #Sets Compute Context to the Cluster rx. Options( compute. Context = PHSCLUSTER ) #Sets Compute Context to the Local Machine rx. Options( compute. Context = Rx. Local. Seq())

Setting a Progress Timer #Create a Progress Bar Object pb <- win. Progress. Bar(title

Setting a Progress Timer #Create a Progress Bar Object pb <- win. Progress. Bar(title = "progress bar", min = 0, max = total, width = 300) for(i in 1: total){ data 1<-rnorm(n=100, mean=0, sd=1) #Update the Progress Bar with the Current Unit set. Win. Progress. Bar(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)

Other Features

Other Features

Revo. Scale. R Package

Revo. Scale. R Package

Revo. Scale. R Package

Revo. Scale. R Package

Revo. Scale. R Package

Revo. Scale. R Package

Deploy. R

Deploy. R

Deploy. R

Deploy. R