I am trying to practice the "tidy" transformation of the data by using pivot_long. Using the movie dataset from the ggplot2movies package. I am curious to know how I can pivot the binary columns into a wide table by creating a new column "genre": something like

Here is my code for the first step, I filter all Action and Romance movie out:
movies %>%
select(title, rating,Action,Romance)%>% filter(Action==1|Romance==1)
if I do the following:
movies %>%
select(title, rating,Action,Romance)%>%
filter(Action==1|Romance==1)%>% #select the Action and Romance movies
pivot_longer(names_to = "genre",
values_to = "Yes/No",
cols = -title)%>%