To use this AddIn, you need to click the highlighted “Addins” drop-down here and underneath the tab for xaringan (which will likely be all the way at the bottom of menu because it is ordered alphabetically): RStudio Addin mentioned on slide 5 is a great idea since you’ll be able to get real-time visual feedback as you update the code (that is, every time you SAVE the code, the visual feedback will be updated). So you can look through the slides and follow along! What’s great is that the template that is created is actually basically a tutorial. So now that I’ve made those changes, I can knit again, and my title page now has my name, along with an updated date & title! For instance, under output, the xaringan::mood_reader has the parameter highlightStyle set to “github.” Since the presentation suggests that the YAML header inputs correspond to the title slide (e.g., YAML header title is set to “Presentation Ninja”), I went ahead and changed title, author, and date for my purposes, leaving other YAML settings as they were: So for instance, I immediately notice that there is a YAML header with a few unique parameters, presumably specific to xaringan. I would highly recommend taking a few minutes to just look at the code and the presentation to see how the input affects the output. It can even be knitted immediately, which should show up right next to your code under the viewer tab - make sure to save it first! Now, you should have a template slide deck that you can edit right away! Super easy. Click “From Template” and at the bottom of the list you should see “Ninja Presentation”. A new window should appear, with four possible options for creating the new RMarkdown file: “Document,” “Presentation,” “Shiny,” or “From Template”. Once xaringan is installed, you can create the new template from the drop-down menu on RStudio (assuming you are using RStudio): File -> RMarkdown. To be able to create a new xaringan template, we need to install the xaringan package using install.packages("xaringan") The rest of this post will be focused on setting up a presentation using the xaringan package. This post where he explains why he prefers remark.js (which is used behind the scenes to render the presentation) for xaringan presentations over other presentation frameworks. I decided to go with xaringan because I’ve been a fan of Yihui Xie’s (creator of the xaringan package) work with other packages and was also persuaded by What options do I have to make presentations in R? Now that I’ve hopefully convinced you of the benefits of using R for presentations, you may be wondering… It’s much easier to make those changes using code compared to setting the image size one each slide manually For instance, let’s say I want to have all of the images on my slides to be a certain size. With R, you’ll spend less time spent messing around with formatting. More notably, this means that if you need to update the slides in the future, you will be able to do so painlessly - instead of having to go in slide-by-slide and updating each. Instead of having to manually copy and paste the results of your statistical test or the output from ggplot, you can simply write a line of code or two to add those into your presentation. If you use R to run your analyses, you can easily integrate your graphics & results into your presentation. First, I’ll highlight some of the biggest benefits of learning how to create presentations in R. In this post, along with ones to follow, I’ll walk through how to do this. As someone who is always searching for ways to automate the manual, error-prone parts of my work so I can spend more time on the important things, I was delighted to learn that there is an option to reduce some of the burden of creating and updating slides by creating presentations in R. So the night before this big presentation, you end up spending more time trying to manually update the slides one by one than preparing for the presentation itself. However, as you are going through the slides, you notice there is an error in your analyses and you need to update the results on ALL of your slides. Many of us have faced this dilemma: it’s the night before a big presentation and you want to make sure you are prepared.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |