I am struggling a bit with a dataframe column (from long to wide) conversion where I have more than 300 columns. Like a pivot operation but only for one column where the character of that column should be used to create presence/absence in the new columns..
One of the columns includes more than 1000 unique character strings (different agricultural practices). I would like to convert that column into multiple columns with binary presence/absence values for each of the unique character strings in the original column.
I could only find help online for this kind of operation if writing all the header names of the new columns (wide), based on the character strings in the "long".
(If possible, a tidy version of the code would be very welcomed)
P.S.: Also suggestions to how to frame this question is welcomed.
Thank you!