Hi I am reading data from API which gives the output like this after converting it into a data frame.
Now I am struggling with arranging the data in columns.
To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:
Short Version
You can share your data in a forum friendly way by passing the data to share to the dput() function.
If your data is too large you can use standard methods to reduce it before sending to dput().
When you come to share the dput() text that represents your data, please be sure to format your post with triple backticks on the line before your code begins to format it appropriately.
It looks like the pivot_longer function might help you here, although I agree with @nirgrahamuk that we'll be able to help you more easily if you can provide data in an easily reproducible format.