Slidify R



  1. Slidify Reveal Js
  2. Slidify R
  3. Slidify R Tutorial
  4. Slidify R Package
  5. Solidify Rochester

Slidify allows you togGenerate reproducible html5 slides from R markdown It is is an almagamation of other technologies including knitr, Markdown, and several javascript libaries It allows embedded code chunks and mathematical formulas. Feb 24, 2014 Slidify: Modern, simple presentations written in R Markdown As a LaTeX fan I’m used to using Beamer for presentations, but the built-in themes are definitely starting to show their age — and writing a custom.sty file looks like a nightmare — so for a while I’ve been looking at trying out an HTML5 framework.

Source: R/dplyr-slidify.R

slidify returns a rolling (sliding) version of the input function, with arolling (sliding) .period specified by the user.

Arguments

.f

A function, formula, or vector (not necessarily atomic).

If a function, it is used as is.

If a formula, e.g. ~ .x + 2, it is converted to a function. Thereare three ways to refer to the arguments:

  • For a single argument function, use .

  • For a two argument function, use .x and .y

  • For more arguments, use ..1, ..2, ..3 etc

This syntax allows you to create very compact anonymous functions.

If character vector, numeric vector, or list, it isconverted to an extractor function. Character vectors index byname and numeric vectors index by position; use a list to indexby position and name at different levels. If a component is notpresent, the value of .default will be returned.

.period

The period size to roll over

.align

One of 'center', 'left' or 'right'.

.partial

Should the moving window be allowed to return partial (incomplete) windowsinstead of NA values. Set to FALSE by default, but can be switched to TRUE to remove NA's.

.unlist

If the function returns a single value each time it is called,use .unlist = TRUE. If the function returns more than one value, or a morecomplicated object (like a linear model), use .unlist = FALSE to createa list-column of the rolling results.

Details

The slidify() function is almost identical to tibbletime::rollify()with 3 improvements:

  1. Alignment ('center', 'left', 'right')

  2. Partial windows are allowed

  3. Uses slider under the hood, which improves speed and reliability by implementingcode at C++ level

Make any function a Sliding (Rolling) Function

slidify() turns a function into a sliding versionof itself for use inside of a call to dplyr::mutate(), however it worksequally as well when called from purrr::map().

Because of it's intended use with dplyr::mutate(), slidifycreates a function that always returns output with the same length of theinput

Alignment

Rolling / Sliding functions generate .period - 1 fewer values than the incoming vector.Thus, the vector needs to be aligned. Alignment of the vector follows 3 types:

  • center (default):NA or .partial values are divided and added to the beginning andend of the series to 'Center' the moving average. This is common in Time Series applications (e.g. denoising).

  • left:NA or .partial values are added to the end to shift the series to the Left.

  • right:NA or .partial values are added to the beginning to shift the series to the Right. This is common inFinancial Applications (e.g moving average cross-overs).

Slidify Reveal Js

Allowing Partial Windows

A key improvement over tibbletime::slidify() is that timetk::slidify() implements.partial rolling windows. Just set .partial = TRUE.

Slidify R

References

  • The Tibbletime R Packageby Davis Vaughan, which includes the original rollify()Function

Slidify R Tutorial

See also

Transformation Functions:

  • slidify_vec() - A simple vectorized function for applying summary functionsto rolling windows.

Slidify R Package

Augmentation Functions (Add Rolling Multiple Columns):

  • tk_augment_slidify() - For easily adding multiple rolling windows to you data

Slidify r markdown example

Slider R Package:

Solidify Rochester

  • slider::pslide() - The workhorse function that powers timetk::slidify()

Examples

The Github repository for this website :choux130/slide_thesis_ioslides.
The link to my slides :https://choux130.github.io/slide_thesis_ioslides/#1

Having an opportunity to give a presentation for my master thesis, I decided to give it a try on R Markdown Presentation with interactive graphs and planned to publish it online after the presentation. There are three main choices in R Studio for the R Markdown Presentation: ioslides, Slidy, and Beamer. Beamer is for .pdf file which cannot show the interactive graphs and not meets my need for this time. Both ioslides and Slidy are for .html file which can be opened in browser and can insert interactive graphs in it. And, the main reason for me to choose ioslides rather than Slidy is simple. The sample slides for ioslides looks prettier to me! I also did some research online and found that Slidify has huge online community and popularity. So, as a person who love to explore new and good things, Slidify successfully aroused my interest.

To sum up, this post is about the comparison between ioslides and Slidify from my experience making slides for my master thesis presentation. Well, I think I am not the only one who did this kind of comparison. Check out Introduction to Presentations in Rmarkdown from Ian Kloo.

Details

  • Slidy
    • Pros:
      1. Already has css file in the template. You can easily customize it to meet your own needs.
      2. It includes so many features which make it easier for user to create fancy slides.
      3. The online communities is big and helpful.
      4. The online documentation and resources is good!
        Slidify,Slidify and rCharts,Example slidify - Joseph V. Casillas
      5. It can easily be published to Github Pages.
    • Cons:
      1. Though it works well for rendering interactive graphs, it is time consuming. I am not sure the reason, maybe it is because it has too many features. This is also the main reason for me to jump to ioslides.
      2. It takes time to be familiar with its settings and structure. It is just a little bit complicated.
      3. It can render htmlwidgets but the size and other features can not be adjusted. What a pity!
  • ioslides
    • Pros:
      1. The time for compiling is not too bad especially when we have many interactive graphs in it.
      2. The template is not so complex, so it is easy to understand the structure by looking at the source code.
      3. The document from R Studio is also good! http://rmarkdown.rstudio.com/ioslides_presentation_format.html
      4. It can be published on the Github Pages. You just need to rename the generated .html file to index.html and then put the file in the gh-pages branch of your github. To see how I did it, Github repo - slide_thesis_ioslides.
    • Cons:
      1. If you want more features, you have to write your own CSS code. So, it may be overwhelming if you do not have any foundation to CSS and HTML.
      2. Like Slidify, it can render htmlwidgets but the size and other features can not be adjusted. This means that it is useless if you try to adjust the size using this code, <iframe src='/path/name.html' width='200' height='200'></iframe>.
  • Interactive Graphs
    • R packages

      1. Plotly
        To make ggplot become interactive.
      2. DT
        To make table become interactive.
      3. htmlwidgets
        Save the interactive output generated from plotly and DT as HTML widgets and then insert widgets in desired place using code, <iframe src='/path/name.html'></iframe>.
    • Examples
      My final slides : https://choux130.github.io/slide_thesis_ioslides/#1
      All the ioslides files : Github repo - slide_thesis_ioslides

Click the tags at the right!


Scroll the bar at the right to see all the dataset!