3 ‘Real’ data

Note: If you already lucky enough to have nicely formatted data, ready for use in R, then you could skip this section and revisit it later, save for the section on factors and other variable types.

Most tutorials and textbooks use neatly formatted example datasets to illustrate particular techniques. However in the real-world our data can be:

  • In the wrong format
  • Spread across multiple files
  • Badly coded, or with errors
  • Incomplete, with values missing for many different reasons

This chapter will give you techniques to address each of these problems.