Seperating several observations of a variable and building a matrix

I think you would use tidyverse/tidyr's pivot_longer function.
For more detailed support please take a few moments and make a reprex.