I have what should be a simple reshaping problem, but I can\'t figure it out. Part of my data looks like this:
foo <- structure(list(grade = c(3, 3, 4, 4,
It is not as pretty as reshape, but
data.frame(grade = foo[2 * (1:(nrow(foo)/2)),]$grade,
SS = foo[foo$var.type == "SS", ]$var.val,
SE = foo[foo$var.type == "SE", ]$var.val )
produces
grade SS SE
1 3 120 47
2 4 120 46
3 5 120 46
4 6 120 47
5 7 120 46
6 8 120 46
7 3 120 12
8 4 120 14
9 5 120 16
10 6 120 20
You have to assume the data comes in pairs of rows for this.