Introduction
We use melt() to turn wide data into long data. This helps us see data in a simpler, tidy format.
You have a table with many columns for similar data and want to combine them into one column.
You want to prepare data for charts that need long format, like line plots.
You want to make it easier to filter or group data by a variable that is spread across columns.
You want to clean data before analysis or machine learning where long format is preferred.