My dataset consists of information about the degree(s) students obtained upon graduation. So, if a student graduates with two degrees, he/she will appear twice. For example:
StudentID DegreeType Date MajorName
1 BS 04/20/16 Biology
1 BA 04/20/16 Math
Some students just appear once because they've only completed one degree.
I'm trying to change the dataset from "long" to "wide" format but cannot get what I'm looking for. I've used dcast
and reshape
but to no avail. I need something like this
StudentID DegreeType1 DegreeType2 Date1 Date2 MajorName1 MajorName2
Any suggestions would be great.