I have 16 GB RAM and despite that my R studios is hanging after I run spread function. My data (a data frame) is of size only 14.8MB(as shown in R environment).
After I run the command, the memory usage goes from 2GB to 15.5 GB (RAM).
Spread has been superceded by pivot_wider in the latest versions of the tidyverse. I would try that? If it's not available in your tidyverse, then upgrade your version.
If there is still a problem after that, be sure to let us know