The goal of this challenge is to read complex data on wins and losses for all World Series games.

We want to to read the data and make a data frame with two columns:

  1. year: the year of the series, sorted in chronological order
  2. pattern: the pattern of wins and losses, for instance “LWLlwwwW”

Notice that the dataset is organized by columns and so the years appear in a strange order.

Proceed as follows:

  1. Mentally think a possible solution, without writing any code
  2. Ask AI to write code in R for to read the data and to explain the code
  3. Read and understand the code. Does the code make sense?
  4. Try the code. Does it work? If not, ask to debug it