I am working with an education data set that describes course offerings. One of the variables describes the range of grades of students who are eligible to take a specific course. For example, grades "9-12". I want to create a tidy data set that includes a row for each possible grade: 9, 10, 11, 12. My first step was to separate the field into the HighestGrade and LowestGrade, but I'm not sure how to take the next step and create rows for grades that aren't explicitly listed the data.

I see two fairly straightforward options at a glance. Both make a list column with all the grades, but I think the second option with map2 is more readable. Note that I added convert = TRUE to the separate function to avoid having to convert the grades to numbers later.

Thank you, I had come across both full_seq() and map2() in my quest for an answer but hadn't been able to use them correctly. I'm going to employ the map2() solution to my actual data as I agree that the readability is much better and I need to force myself to learn more about purrr.