You may be chomping at the bit to model, visualize or report on a data set -- but usually, you'll need to to do some work to get your data into a form where it's ready for your analysis. These tasks can be anything from simple sorting to more complex reshaping to, say, taking information that's in column headers and putting it into cell values.
In this free PDF download, you'll learn several ways to easily add a column to an existing data frame: By equation or by using functions such as transform, apply and mapply.
We'll show you how to get summaries by data sub-groups with the plyr and dplyr packages -- a key skill in analyzing data with multiple categories. Plus you'll learn a bonus way to group data by date ranges using a lesser-known capability of a function in base R.
We'll go over basic data sorting techniques to make it easier to scan your data and analysis results. And you'll learn how to transform your data from "wide" to "long" format as well as from "long" to "wide" -- easily moving column-header categories into values or groups of values. This is often a mandatory step to get your data in a format that can be used by R analysis and visualization packages.
The PDF includes sample code and an easy-to-replicate sample data set, so you can follow along every step of the way.
Register to download "Data wrangling with R" now.
To continue reading this article register now