converting column into singe row using dplyr : I am trying to wrangle my dataset converting a column into a single row.

Original dataset:

[![enter image description here][1]][1]

What I am getting is

[![enter image description here][2]][2]

What I want to have:

[![enter image description here][3]][3]

    library(dplyr)
    library(tidyr)
    
    df <- test %>%
      group_by(cusip, year, typecode, ticker, stkname, indcode) %>%
      summarise(mean_shares=mean(shares), mean_prc=mean(prc))
    
    df_2 <- df%>%
      spread(typecode, mean_shares, fill = 0)


  [1]: https://i.stack.imgur.com/aExCV.jpg
  [2]: https://i.stack.imgur.com/2hpBQ.jpg
  [3]: https://i.stack.imgur.com/QQHwc.jpg