poltmash.blogg.se

Rmarkdown ppt
Rmarkdown ppt





  1. #Rmarkdown ppt how to
  2. #Rmarkdown ppt code
  3. #Rmarkdown ppt professional

#Rmarkdown ppt code

So, I will start with making a graph for a single country using the code below.

#Rmarkdown ppt how to

When I write loops to mass produce graphs, I follow a simple two step process: first, write the code to make the graphs, then figure out what actually need to change to make a the same graph but with different parameters This may seem simple, but I think for beginners it is important to break it down so you don’t get lost in trying to both learn how to do a task and automate it at the same time. Select(indicator, country, iso3c, date, gdp_pct_growth) %>% I have only included the most relevant variables. Below, you can see how the dataset looks based on a random sample of rows. In this case we are only working with one indicator but I still prefer working with long data since it works better with ggplot2 when graphing multiple indicators. The result is a long dataset with a row for each indicator–country–year. Since there are so many different indicators, I actually prefer using the web interface. To find the indicator codes you can either use the function wb_search or just go to the World Bank’s online database and find it there. You can change what indicators you want to pull by using the indicator argument. Here I am grabbing the GDP annual % growth rate, only for countries (excluding regional classifications), between 20. # create new variable so that that gdp_pct_growth is formatted as % The wbstats package makes grabbing data from the World Bank’s database very easy. Since I’ve always worked in the political science world, we are going to look at data from the World Bank. To start with we are going to need to get some example data. The final product will be a single PowerPoint with a slide for each country showing the GDP annual % growth from 2009-2019.Īt the end of the post, I’ll go through briefly another way of tackling this problem using functional programming instead of for loops.Īll of the code used here is also avaiable on GitHub, including the PowerPoint materials Make a loop that adds the graphs to the PowerPoint.This process can be broken down into 4 steps: You should be fairly comfortable with ggplot2 and the basics of loops or you might get lost when we start automating some of the processes. This tutorial will be best suited to intermediate R users. The goal for this post is to show you how to use for loops to automate graph production in ggplot2 and to take those graphs and put them into a PowerPoint deck with the officer package. This is where the officer package comes to the rescue.

rmarkdown ppt

While R Markdown can allow streamlined workflows, it doesn’t always work in collaborative settings where PowerPoint is king. The difficultly with making PowerPoint presentations it is done manually and takes a ton of time.

#Rmarkdown ppt professional

One of the constants in my professional career is making graphs to put into PowerPoint presentations so that findings can be presented to other teams, partners, or clients.







Rmarkdown ppt