I have a data set that is currently being pulled from Redshift of the following format
name nps index
1 company1 8 1
2 company1 4 2
3 company1 7 3
4 company2 6 1
5 company2 9 2
and so on for 82krows. I added the index column when trying to pivot the table in Redshift before I realized that wasn't an option so I'm not sure if it has any use now and I don't necessarily need to keep it.
Ideally I want to get to a point where the data looks like this:
name 1 2 3 4 5 6 7 ...
1 company1 8 4 7
2 company2 6 9
I've tried using the reshape package in r to melt and cast the data but I'm only able to get a count of the nps values that way and I really want the specific scores so I can do and ICC on them by company.
Is there another package in R that can accomplish this? I really don't want to do it by hand as there are 4500+ different names.