I am trying to practice creating some PowerPoint presentations with RMarkdown using RStudio. I have a fairly large dataframe from which to create a ggplot object. I have to create the large data frame first, and then isolate the pieces I need to create the chart (via a variety of maipulations) till I get the data tidy, etc.
Questions:
Do I always need to do all of this within the R Markdown environment? i.e., if he data exists in my Global Environment, it still seems like i need to create it in the R Markdown document as well (or I receive an error.) It seems like this is the case based in what I am seeing in my online searching....
Performing the manipulations on a large data frame seems to be particularly slow in the R Markdown session - is this typical?
Lastly, does anyone know of a PowerPoint Template in R Markdown that creates a 4-Blocker on one slide? For example, I want to create a slide with 4 bar charts (each of equal size and presented nicely on the slide.)
Thanks!
I guess I am asking the right questions (to some degree.)
Here is an excerpt from Yihui Xie's R Markdown text:
"Under the hood, RStudio calls the function rmarkdown::render() to render the document in a new R
session. Please note the emphasis here, which often confuses R Markdown users. Rendering an Rmd document in a new R session means that none of the objects in your current R session (e.g., those you created in your R console) are available to that session.."
Any data manipulation in R Markdown shouldn’t take any longer than if it were executed in a regular, interactive R session. But if you have time consuming processes, you can set the code chunk where you do these operations to cache=TRUE and after the first time you knit the R Markdown file, it will use the cached results.
As for multichart layouts, this can be tricky. I’ve found that using patchwork to compose the layouts and then rendering the the patchwork image to a PPT slide to be an effective method. I wrote up a blog post about this with some code examples here: https://mattherman.info/blog/ppt-patchwork/
Dude! So spot on! Thanks for the message and the references in your blog! I can’t wait to spend some time synthesizing the info there....will be sure to share the solution when I get there! Incidentally, I am also trying to recreate work slides, some of which are 4-blockers (I.e., 4 quadrants each containing a chart) and others are variations of 1, 2, or 3 charts per slide.