Introduction

Before you start: table selection; function calls and returned values.
Setup: No input files are needed. Build the example tables on this page before modifying them.
Your check: Choose sorting, binding, key matching, grouping or reshaping for a task. Practise in the unit summary.

At the end of this unit, you should be able to

  • sort values and reorder rows using an index,
  • combine compatible objects by rows or columns,
  • merge tables by explicit keys and check unmatched or duplicated keys,
  • inspect, combine, search and replace character strings,
  • summarize observations within groups, and
  • reshape a table between wide and long forms while preserving its identifiers.

Use the object structures, indexing and function calls from the earlier units. Most examples use functions supplied with R. The reshaping lesson uses the additional reshape2 package and explains its installation and the reshape2:: notation.

Comments?

You can leave comments below if you have questions or remarks about any of the text or code in this unit. Please copy the corresponding line into your comment to make it easier to answer your question.

Updated: