### old way ```r df %>% mutate(row = row_number()) %>% gather('column', 'source', -row, -N) # key = column, value = source, retain row and N # further transforms ``` ### new way ```r df %>% mutate(row = row_number()) %>% pivot_longer(!c(row , N), names_to = 'column', values_to = 'source') # further transforms ```