Scrollama Document with the Sidebar Layout

Get started

You can create a new Scrollama document with the sidebar layout from the RStudio IDE: File -> New File -> R Markdown -> From Template, and use the template “Scrollama Document (Sidebar Layout)”.

The layout

The main body of the document is displayed in the sidebar on the left. Figures, tables, and videos will be displayed in their full sizes in the main area on the right.

For example, here is a simple table:

A boring table.
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2
Valiant 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1

As you scroll over the document, the first-level section that comes to the view will be highlighted, and the figure or table or video in the view in that section will be displayed on the right (if exists).

Plots

You may include any number of plots in a section.

par(mar = c(4, 4, .5, .1))
plot(cars, pch = 19)
A boring scatterplot.

A boring scatterplot.

for (z in 4:1) curve(z/x, 0, 10, add = z < 4, col = z)
A series of curves.

A series of curves.

Conclusion

That’s it.