Some examples
To get started, let's assume that our data provider from Chapter 3, Understanding Your Data Using R, has supplied additional files to us containing patient survey information, but it has been communicated that the data quality of these files is suspect. In the following examples, we'll see what can be done to address specific concerns and improve the quality of the data.
Some reformatting
A profiling exercise from Chapter 3, Understanding Your Data Using R, was to time box the data to establish a time frame in which the hospital visits were recorded. Using R, we scanned the data looking at the field or column named recorddate and generated a list of four character years found in the file. By looking at the list we were able to establish that the data in the file ranged from 1999 through 2016.
This time, let's assume we've again scanned our data and observed that the recorddate field contains both four-character and two-character length years (as shown in the following screenshot...