Say I have a dataframe that looks like this:
gene drug log2FC
Ubb Naloxone 0.6375514
Tuba1a Naloxone 0.5827224
Scd1 Naloxone -0.7249997
Ubb Aspirin 0.8000
Tuba1a Aspirin 0.73324
Scd1 Aspirin 0.2497
Ubb Haldol 0.0375
Tuba1a Haldol 0.25824
Scd1 Haldol -0.0249997
Would there be an easy way to create columns for each unique drug, so I'm left with something like this:
gene Naloxone_log2FC Asirin_Log2FC Haldol_log2FC
Ubb 0.6375514 0.73324 0.0375
Tuba1a ...
Scd1 ...
Thanks!