RStudio v0.98 Preview

JJ Allaire
July 1st, 2013

Greater Boston useR Group

Debugging Tools

Work in Progress...

Phase 1: Seamless integration with existing R debugging tools (browser, recover, traceback, etc.)

Phase 2: Setting breakpoints in the editor; smooth transitions from runtime errors into debugging tools

New Environment Pane

  • Evolution of the Workspace Pane
  • Ability to expand lists and data frames
  • Object views based on str
  • More intelligent handling of promises
  • Coming:
    • Filtering
    • Highlighting of changed values
    • S3 methods for custom views

R Error Handling

Governed by the global “error” option, which is NULL by default:

options(error = NULL)

Either a function or an expression governing the handling of non-catastrophic errors such as those generated by stop as well as by signals and internally detected errors. If the option is a function, a call to that function, with no arguments, is generated as the expression.

Traceback

options(error = traceback)

Prints the call stack of the last uncaught error, i.e., the sequence of calls that led to the error.

Is often enough to understand the source of an error

Browser

options(error = browser)

Interrupt the execution of an expression and allow the inspection of the environment where browser was called from.

  • Allows full inspection and modification of it's calling environment
  • Supports stepping within the function it's invoked from

Recover

options(error = recover)

Allows the user to browse directly on any of the currently active function calls via an interactive menu.

RStudio Debugging

The built in R debugging tools are powerful and flexible, so the first order of business is to provide seamless integration with those tools

What does that mean? Let's take a look….

Breakpoints Using browser()

  • Call the browser() function to hit a breakpoint anywhere
  • Supports conditions
  • However, leaves artifacts of debugging within the source code

Editor Breakpoints

  • Have some complexity due to the need to source files prior to setting breakpoints
  • If we know enough about intention/context then we can get them to work pretty naturally
  • Optimistic we can get this right for package development, likely also for interactive work with source()
  • Not in v0.98 yet but we are working on this now

R Presentations

What are R Presentations?

  • An easy way to create HTML5 presentations using R Markdown
    • Good for presentations that incorporate code, plots, and math.
    • Not as good for presentations that require highly customized layout and appearance
  • Extensive support for authoring and previewing presentations within the RStudio IDE
  • Can be played back either inside the RStudio IDE or as standalone HTML5 presentations in a web browser.

Feature Highlights

  • Easy incorporation of R code and it's output
  • Support for LaTeX equations using MathJax
  • Flexible two column layouts
  • Many options for slide transitions and slide navigation
  • Ability to customize the appearance of slides using CSS

Demo: Presentation Authoring

  • Creating a Presentation
  • Previewing Presentations
  • Syncing the Editor and Preview

Slide Basics

Title Slide
===================
author: John Doe
date: Feb 7th, 2013



Slide w/ Bullets
===================

- Bullet 1
- Bullet 2
- Bullet 3

R Code Chunks

Slide with Code
===================

```{r}
summary(cars)
```

Code w/o Evaluation
===================

```{r, eval=FALSE}
summary(cars)
```

R Code Chunks (Output Only)

Output Only Slide
===================

```{r, echo=FALSE}
summary(cars)
```

Plot Slide
===================

```{r, echo=FALSE}
plot(cars)
```

Two Column Layouts

Slide with Columns
===================

First column

***

Second column
Slide with Columns
===================
left: 70%

First column

***

Second column

Additional Features

  • Several transition types (linear, rotate, fade, zoom, concave)
  • Incremental display of bullets (or other slide elements)
  • Slide-to-slide links
  • Opening source files in the IDE
  • Override default fonts and formatting via CSS

Displaying and Publishing Presentations

  • Playback inside the RStudio IDE
    • Use zoom to toggle full window view
  • Standalone HTML5 presentations in a web browser
  • Publish to RPubs

Questions?

Thank You!

Download the v0.98 preview release at:

http://www.rstudio.com/ide/download/preview

Slides for this talk are at:

http://rpubs.com/jjallaire/v0_98-preview-boston-useR