Hi everybody, I was able to pivot longer an object by using pivot_longer and then pivot_wider. I want to know if it is possible to do with only pivot_longer command? Thanks.

```
# Data set
df = tibble(key=1:2, x_1=paste('x', 1:2, sep=''), x_2=paste('x', 3:4, sep=''),
y_1=paste('y', 1:2, sep=''), y_2=paste('y',3:4, sep=''),
z_1=paste('z', 1:2, sep=''), z_2=paste('z',3:4, sep=''))
df
# Desired output
df_long=tibble(key=rep(1:2,2), x=paste('x',1:4, sep=''), y=paste('y',1:4, sep=''), z=paste('z',1:4, sep=''))
df_long
# Long solution
pivot_longer(df,cols=2:7, names_to=c('var','rep'), names_pattern=("(.)_(.)"), values_to = 'val') %>%
pivot_wider(names_from='var', values_from='val')
```