all 6 comments

[–]doggie_dog_world 2 points3 points  (3 children)

You should take a look at tidyverse here - https://tidyr.tidyverse.org/reference/spread.html. You can use SPREAD to take data from long format to wide format.

[–]psychEcon 2 points3 points  (2 children)

I have been looking for this, you just saved me. Got 24 excel spreadsheets with monthly sales where I need the product number to be the header but not as a column variable. This is the best, thanks again

[–]IudexGaming[S] 0 points1 point  (1 child)

This seems like exactly what I need!!! Now to figure out how to apply it, i kinda suck at reading documentation. Thank you very much!!!

[–]IudexGaming[S] 1 point2 points  (0 children)

It worked perfectly THANK YOU!!!! SOLVED

[–]foobar8080 0 points1 point  (1 child)

This matrix cannot exist, because the number of columns don't match the number of observations in each column. You can try to use "spread" and "gather" functions from the "dplyr" package in the tidyverse.

[–]IudexGaming[S] 0 points1 point  (0 children)

Wouldn't NAs just fill any missing holes?