Data Modification

Welcome to our module about data modification. Data rarely arrive in a perfect, ready-to-analyze form. Instead, they must be filtered, sorted, and transformed so that patterns become visible and variables take on meaningful structure.

  1. Subsetting
  2. Sorting
  3. Transforming data

Each tutorial will comprise a series of interactive lessons with practice problems embedded throughout.

Learning Goals

After completing this module, you will be able to:

Subsetting Data

  1. Extract specific rows, columns, and elements from datasets using Base R and dplyr.
  2. Apply logical conditions to filter data efficiently.
  3. Use tools like filter() and select() to subset data clearly and reproducibly.

Sorting Data

  1. Reorder values or rows in ascending or descending order.
  2. Use dplyr::arrange() to sort data frames by one or more variables.

Transforming Data

  1. Convert variables into factors with defined levels.
  2. Create, modify, and standardize variables using mutate().
  3. Apply operations across multiple columns with across().
  4. Build new variables conditionally using case_when().
  5. Rename variables programmatically using rename() and rename_with().

Click the button below to get started with the first tutorial.

Back to top