Concept Flow - pivot_longer (wide to long)
Start with wide data
Select columns to pivot
Gather columns into key-value pairs
Create new 'name' column for keys
Create new 'value' column for values
Return long format data
End
pivot_longer takes wide data and turns selected columns into two columns: one for the old column names (keys) and one for their values, making data longer.