R with ggplot2 is capable of producing visually appealing charts and is definitely more versatile than Excel for what concerns graphical representation of data. When it comes to presenting the results of an analysis though, PowerPoint is still the most widely used application, at least in the business environment.
This article shows a workflow to bring your ggplot2 charts to PowerPoint automatically, so you can build your analysis presentation directly from an R script within RStudio.
You may have noted that my blog site has a new look. Well, that was totally unplanned and actually the consequence of a major problem that occurred today. Luckily enough solving it turned into a learning moment. I am going to share my findings here so that others can benefit from them. While my problem was specific, the steps I used to isolate it apply to a broader range of issues.
Some background information first: my blog is based on the Gantry Framework, which consists of a plugin and a theme. The plugin and the theme work together in order to provide a framework through which you can easily set the look and feel of the blog pages, layouts, widgets, etc. Very practical if you don’t want to spend time programming an own template or tweaking one of the many available boilerplates.
One of the first steps when working with a fresh data set is to plot its values to identify patterns and outliers. When outliers appear, it is often useful to know which data point corresponds to them to check whether they are generated by data entry errors, data anomalies or other causes.
Unfortunately ggplot2 does not have an interactive mode to identify a point on a chart and one has to look for other solutions like GGobi (package rggobi) or iPlots.
However, if all is needed is to give a “name” to the outliers, it is possible to use ggplot labeling capabilities for the purpose. While labeling all points would usually produce a crowded and difficult to read plot, we can limit the labeling only to those points that respect certain conditions, namely our outliers.
If you are making the transition from Excel to R and still can’t figure out how to quickly obtain pivot tables like Excel has, this article is for you!
Actually it is pretty easy to produce Pivot Tables in R. All you need is a package called reshape by Hadley Wickham (yes, the same prolific author of plyr and ggplot2) and some understanding of how reshape “thinks” and works.
R is not just for statistical analysis and data mining, it can also be employed to prepare nice infographics. Here is a quick example of infographic with R.
With few lines of R code we can create, starting from commonly available data, an infographic showing the relative magnitude of the population for the different countries around the world, with the country name placed on the country centroid (like it would be on a map) and the font size proportional to the population size. Simple but impactful!