class: center, middle, inverse, title-slide .title[ # R Presentations ] .author[ ###
Ying-Ju Tessa Chen, PhD
Associate Professor
Department of Mathematics
University of Dayton
@ying-ju
ying-ju
ychen4@udayton.edu
] --- ## Learning Objectives In this session, we will introduce - **R Markdown Presentation** - **ioslides:** Lightweight, HTML-based slides. - **Slidy:** General HTML slide support. - **beamer:** LaTeX-based PDF presentations. - **PowerPoint:** Direct PowerPoint slide generation. - **xaringan:** Highly customizable HTML slides using remark.js. - **flexdashboard:** Interactive dashboards that can act as slides - **Quarto:** Modern, versatile presentations supporting multiple formats. --- ## Rmarkdown Presentations In order to create a Rmarkdown presentation, we click .green[File] and then find .green[New File] and then .green[R markdown ...] There are four options: - Html (ioslides): This format allows us to create a slide show and the slides could be broken up into sections by using the heading tags # and ##. If a header is not needed, a new slide could be created using a horizontal rule (- - -). - Html (Slidy): Similar to ioslides, this format allows to create a slide show broken up into sections by using the heading tag ##. If a header is not needed, a new slide could be created using a horizontal rule (- - -). A Slidy presentation gives a table of content while an ioslides presentation doesn't. - PDF (beamer): This format allows to create a beamer presenation (LaTex). The slides could be broken up into sections by using the heading tags # and ##. If a header is not needed, a new slide could be created using a horizontal rule (- - -). - PowerPoint: This format allows you to create PowerPoint slide decks directly from R Markdown. The generated .pptx files are fully editable in Microsoft PowerPoint, enabling you to make additional tweaks if needed. **Note:" The extension of R markdown file is .blue[.Rmd]. --- ### Rmarkdown Presentations (Continued) <div class="figure" style="text-align: center"> <img src="data:image/png;base64,#../figs/presentation.JPG" alt="Creating a Rmarkdown Presentation" width="50%" /> <p class="caption">Creating a Rmarkdown Presentation</p> </div> --- ### Rmarkdown Presentations (Continued) In the following, we show an example of the header of a Rmarkdown file. <img src="data:image/png;base64,#../figs/Rmarkdown_heading.JPG" width="40%" style="display: block; margin: auto;" /> We can use the output option to manipulate which presentation we would like to have. - output: ioslides_presentation - output: slidy_presentation - output: beamer_presentation - output: powerpoint_presentation To render an R Markdown document into its final output format, we can click the .green[Knit] button to render the document in RStudio and RStudio will show a preview of it. The further settings for presentations could be found at [R Markdown: The Definitive Guide](https://bookdown.org/yihui/rmarkdown/presentations.html) --- ## xaringan Presentation A easy way to start creating a xaringan presentation is to use the R markdown template with .green[Ninja Presentation] or .green[Ninja Themed Presentation]. xarignan Presentation has a specific CSS format file: .green[xaringan-themer.css] that we can use to customize the theme of presentations. <div class="figure" style="text-align: center"> <img src="data:image/png;base64,#../figs/xaringan.JPG" alt="Creating a Rmarkdown Presentation" width="30%" /> <p class="caption">Creating a Rmarkdown Presentation</p> </div> A comprehensive tutorial regarding xaringan presentation could be found at [xaringan Presentation](https://bookdown.org/yihui/rmarkdown/xaringan.html). --- ## Flex Dashboard A easy way to start creating a Flex dashboard is to use the R markdown template with .green[Flex Dashboard]. <div class="figure" style="text-align: center"> <img src="data:image/png;base64,#../figs/dashboard.JPG" alt="Creating a Flex Dashboard" width="30%" /> <p class="caption">Creating a Flex Dashboard</p> </div> - We can use # to create multiple pages. - We can use .green[orientation] in the .green[output] options to specify the layout to be .green[columns] or .green[rows]. A comprehensive tutorial regarding Flex Dashboard could be found at [flexdashboard](https://pkgs.rstudio.com/flexdashboard/) --- ## Quarto for Presentations Quarto is a versatile, modern tool for creating dynamic presentations, supporting multiple languages like R, Python, and Julia. Here's why and how to use Quarto for presentations: **Advantages of Quarto:** - `Flexible Outputs:` Supports Reveal.js, Beamer, PowerPoint, and PDF outputs. - `Multi-Language Support:` Combine .green[R], .green[Python], .green[Julia], or other code in a single document (See [Quarto](https://quarto.org/)). - `Custom Themes:` Easily create custom themes with CSS or built-in options. - `Interactive Features:` Integrates seamlessly with interactive elements, such as HTML widgets and Shiny apps. To create a Quarto presentation with RStudio, we click .green[File] and then find .green[New File] and then .green[Quarto Presentation ...]. **Note:** The extension for a Quarto file is .blue[.qmd]. --- ## Comparison
--- ## Instructions for Hosting HTML Files via Bitbucket We assume that the audience is familiar with the Bitbucket platform. Follow these steps to host HTML files via Bitbucket: .small[ - **Create or Select a Workspace:** If you don’t already have a workspace, create one. For example, let's name the workspace .green[presentations]. - **Create a Repository:** Inside the workspace, create a repository with the name .green[presentations.bitbucket.io]. Here, the name of the repository must be .red[name of workspace].green[.bitbucket.io]. - **Upload HTML Files:** Add your HTML files (e.g., .green[file1.html], .green[file2.html], etc.) to this repository. If you organize files into folders within the repository, ensure the structure matches your intended URLs. - **Access Your Files via URL:** Once uploaded, the files can be accessed at: - .green[https://presentations.bitbucket.io/file1.html] - .green[https://presentations.bitbucket.io/file2.html] - **If the files are saved in a folder, their URLs will follow this structure:** - .green[https://presentations.bitbucket.io/foldername/file1.html] - .green[https://presentations.bitbucket.io/foldername/file2.html] .red[Tired of Using git commands to upload files to Bitbucket?] Watch this video to learn [how to use GitHub desktop with Bitbucket](https://www.youtube.com/watch?v=FO-LLKc2GC8). ] --- # Summary of Main Points By now, you should know how to create different types of presentation such as - **R Markdown Presentation** - **ioslides:** Lightweight, HTML-based slides. - **Slidy:** General HTML slide support. - **Beamer:** LaTeX-based PDF presentations. - **PowerPoint:** Direct PowerPoint slide generation. - **xaringan:** Highly customizable HTML slides using remark.js. - **flexdashboard:** Interactive dashboards that can act as slides - **Quarto:** Modern, versatile presentations supporting multiple formats. --- ## In-Class Activity To be announced in class. <br> ## Thank you! .pull-left-2[ Please do not hesitate to contact me (Tessa Chen) at <a href="mailto:ychen4@udayton.edu"><i class="fa fa-paper-planee fa-fw"></i? : ychen4@udayton.edu</a> for questions or further discussions. ] .pull-right-2[ <img src="data:image/png;base64,#../figs/Tessa_grey_G.gif" width="50%" style="display: block; margin: auto;" /> ]