I have data resembling a much, much larger version of the first chart below. I would like to "unmelt" it into the second chart, but I cannot do it efficiently. At the