A suggestion. Sometimes the column names provide no new/useful information as the values encode the same (or better) information. In this case, the names column is unwanted and dropped soon after the pivot.
If names_to can create one or more columns based on patterns, could it be extended to allow 0 columns to simplify the pivot_longer(names_to = "junk") %>% select(-junk) pattern?
A suggestion. Sometimes the column names provide no new/useful information as the values encode the same (or better) information. In this case, the names column is unwanted and dropped soon after the pivot.
If
names_tocan create one or more columns based on patterns, could it be extended to allow 0 columns to simplify thepivot_longer(names_to = "junk") %>% select(-junk)pattern?