Most organizations generate their reports through a database / Excel combination. Excel is not suited for repetitive work that involves large amounts of data. The result is a resource-intensive and error-prone process, that outputs ugly plots.
The good news is that the data pipeline can be completely automated in R.
This means that text, plots and tables update when the underlying data changes. The benefits of this approach are:
Data on population, economy and agriculture have been obtained from:
The World Bank.
This is a sample report that shows different ways to visualize information from datasets in an automated fashion. There is therefore no particular order in the paragraphs.
With “automated” the following is meant:
You can use multiple data sources (databases, Word, Excel, PDFs etc) and extract the data therein.
The information is extracted, combined, cleaned and plotted automatically. This means that the entire report updates automatically whenever you update the datasets.
The report can be generated in html, Word, PDF or Excel format.
The yearly harvest of maize in Kenya is available via FAOSTAT.
The graph below is interactive. You can:
Hover your mouse over the data points in order to see the underlying values;
Drag the sliders under the graph to focus on a particular time window;
Change the time period in the box in the lower left of the timeline to smooth the graph using moving averages (try 5 and 10 for to get 5 and 10 year moving averages).
The ownership of land is reported by the Kenyan government. Land can be owned, rented/leased, communal, made available for free or other. The plot below shows the “owned” situation.
The plot below is interactive. You can:
click on a part of the map to see the county and the underlying value.
use the “+” and “-” buttons in the top left of the plot to zoom in and out.
measure areas and distances using the widget in the upper right corner of the plot.
Data on population growth and densities are made available by the World Bank. By plotting different variables together you can see their relations.
What you see:
The Kenyan population is increasing. The rural population is increasing as well, but less rapidly so. The rural population as percentage of the total population is therefore decreasing.
The agricultural land acreage is increasing slowly, but not fast enough for the increasing rural population. The rural population density is therefore increasing rapidly.
The added value of agriculture in the economy and other economical indicators for Kenya are made available via the World Bank. By plotting the variables separately you can see their relations.
What you see:
Agriculture production has increased, and the value added of agriculture production even more.
The GDP of Kenya has increased even sharper, and the percentage contribution of agriculture is therefore decreasing.