I have this dataset:
col1 col2
a c(1,2)
b 5
I want this dataset:
col1 col2_1 col2_2 col2_5
a TRUE TRUE FALSE
b FALSE FALSE TRUE
I know I have to use pivot wider. But I don't know how! Would you please help?