Skip to main content

Posts

Showing posts from December, 2013

Three Quick and Simple Data Cleaning Helper Functions (December 2013)

As I go about cleaning and merging data sets with R I often end up creating and using simple functions over and over. When this happens, I stick them in the DataCombine package. This makes it easier for me to remember how to do an operation and others can possibly benefit from simplified and (hopefully) more intuitive code. I've talked about some of the commands in DataCombine in previous posts . In this post I'll give examples for a few more that I've added over the past couple of months. Note: these examples are based on DataCombine version 0.1.11. Here is a brief run down of the functions covered in this post: FindReplace : a function to replace multiple patterns found in a character string column of a data frame. MoveFront : moves variables to the front of a data frame. This can be useful if you have a data frame with many variables and want to move a variable or variables to the front. rmExcept : removes all objects from a work space except those specified...