The opposite of spread is not transposing, rather gather, also provided in tidyr package.
However, developments of both of these two functions are not continued in favour of pivot_longer and pivot_wider functions, available in the tidyr from version 1.0.0.
Try yourself with pivot_longer, and if you fail to solve your problem, please share a small part of the data set in a copy-paste friendly format.
In case you don't know how to do it, there are many options, which include:
-
If you have stored the data set in some R object, dput function is very handy.
-
In case the data set is in a spreadsheet, check out the datapasta package. Take a look at this link.