Automatically creating a deck with slides using R
You can use R code to automatically create a deck.
Examples using R code
The following example shows you how to create one deck and one analysis.
Creating a new deck (in the deck catalog)
newDeck(ds, "My Deck")
Checking what decks you have (optional)
Accessing and storying your deck from the deck catalog
deck <- decks(ds)[["My Deck"]]
Creating a slide with the analysis you want in the deck
In order to create an analysis, you must query within the newSlide() function.
newSlide(deck, query = ~row_variable + column_variable, title = "My title", subtitle = "My subtitle", display_settings = list(vizType = "horizontalBarPlot") )
- The aliases of your respective row and column variables.
- title and subtitle
- The labels you'd like to give these respectively.
- The type of graph you'd like to create. To see the full list available, use ?newSlide and see the documentation.
Recommended next steps
The following are suggestions to help you further automate the process:
- If you have a lot of slides to create, you could consider running a loop through a data.frame of aliases and viz types.
- To aid the loop, you can consider using a .csv that you can read in.