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

      .packages = c("ggplot2","plotly", "DT", "htmlwidgets")
      .inst <- .packages %in% installed.packages()
      if(length(.packages[!.inst]) > 0) install.packages(.packages[!.inst], repos = "http://cran.us.r-project.org")
      notshow = lapply(.packages, require, character.only=TRUE)
      
      ###############
      #### GRAPH ####
      ###############
      
      #### 1. Pepare Data ####
      datt=read.csv("/Users/chou/GoogleDrive/UMN2014-2017/Plan B/final/clean_dat.csv",header=TRUE)
      levels(datt$PMD)=list(P="P",M="M",D="D")
      
      #### 2. Generate ggplot ####
      hist_PMD_a=ggplot(datt, aes(x=Area, color=PMD, fill=PMD))+
        geom_histogram(aes(y=..density..), alpha=0.5,
                       position="identity")+
        geom_density(alpha=.3)
      box_PMD_a=ggplot(datt, aes(x=PMD, y=Area, fill=PMD)) +
        geom_boxplot(outlier.shape=NA, outlier.colour = NA) +
        geom_point(position = position_jitter(h=0,w=0.3))
      
      #### 3. Convert to interactive plots using plotly ####
      p1 = plotly_build(hist_PMD_a)
      p2 = plotly_build(box_PMD_a)
      p = subplot(p1,p2, margin=0.05)
      
      #### 4. Convert to a HTML widget using htmlwidgets ####
      path = paste("./area.html", sep="")
      saveWidget(as_widget(p), file = path)
      
      ###############
      #### TABLE ####
      ###############
      
      #### 1. Prepare Data ####
      dat = datt[,-c(1,4,5)]
      names(dat) = c("Sample ID", "# in image", "image No.",
                     "image name", "location", "PMD", "SI",
                     "Area", "Perimeter", "Circularity",
                     "Aspect Ratio")
      
      #### 2. Convert to interactive table using DT ####
      d=datatable(dat)
      
      #### 3. Convert to HTML widget using htmlwidgets ####
      path <- paste("./dat.html", sep="")
      saveWidget(as_widget(d), file = path)
Click the tags at the right!


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