Hello, I have a data in the format of as below:
squads <- tibble::tribble(
~`1`, ~Black.pepper, ~Chili.lime, ~Nashville.hot,
2L, "BBQ", "Honey mustard", "Teriyaki",
3L, "Buffalo", "Korean BBQ", NA,
4L, "BBQ", "Chili lime", "Korean BBQ",
5L, "BBQ", "Black pepper", "Chili lime",
6L, "BBQ", "Buffalo", "Nashville hot",
7L, "BBQ", "Buffalo", "Honey mustard",
8L, "Black pepper", "Gochujang", "Korean BBQ",
9L, "Black pepper", "Chili lime", "Gochujang",
10L, "Chili lime", "Gochujang", "Indian curry",
11L, "Kung pao", "Peri Peri", "Sweet heat",
12L, NA, NA, NA,
13L, "Buffalo", "Gochujang", "Korean BBQ",
14L, NA, NA, NA,
15L, "BBQ", "Black pepper", "Chili lime"
)
head(squads)
#> # A tibble: 6 x 4
#> `1` Black.pepper Chili.lime Nashville.hot
#> <int> <chr> <chr> <chr>
#> 1 2 BBQ Honey mustard Teriyaki
#> 2 3 Buffalo Korean BBQ <NA>
#> 3 4 BBQ Chili lime Korean BBQ
#> 4 5 BBQ Black pepper Chili lime
#> 5 6 BBQ Buffalo Nashville hot
#> 6 7 BBQ Buffalo Honey mustard
And I want it to be in this form - image below attached:
Created on 2022-04-17 by the reprex package (v2.0.1)