I have a data table that looks like this,
I would like to convert this into the following format:
How this can be done in R?