Skip to content
Prev 383031 / 398503 Next

Duplicate names in the pivot column

Does this help?

df4 <- (   df
       %>% group_by( time, y )
       %>% mutate( lvl = seq.int( n() ) )
       %>% ungroup()
       %>% mutate( y = ifelse( 1==lvl
                             , y
                             , paste( y, "dup" )
                             )
                 )
       )
On March 28, 2020 6:18:51 PM PDT, phil at philipsmith.ca wrote: