I have a data frame built as such:
dput(au.weighted.scores)
structure(list(AUDIT = c(0.283333333333333, 0.283333333333333,
0.183333333333333, 0.3, 0.2625), CORC = c(0.2, 0, 0.76, 0.82,
0.545), GOV = c(0.82, 0.82, 0.74, 0.66, 0.76), PPS = c(0.2, 0.2,
0.2, 0.266666666666667, 0.216666666666667), TMSC = c(0.525, 0.525,
0.25, 0.158333333333333, 0.189583333333333), TRAIN = c(0.233333333333333,
0.233333333333333, 0.216666666666667, 0.266666666666667, 0.2375
)), .Names = c("AUDIT", "CORC", "GOV", "PPS", "TMSC", "TRAIN"
), row.names = c(NA, -5L), class = "data.frame")
I need to add a column of names that accompany the rows of this data frame. The column is c("Group1", "Group2", "Group3", "Group4", "Group5").
How can I add this column of names in with it's own column name like "Group_Name"?
The end result would look like this:
au.weighted.scores
Group_Name AUDIT CORC GOV PPS TMSC TRAIN
1 Group1 0.2833333 0.200 0.82 0.2000000 0.5250000 0.2333333
2 Group2 0.2833333 0.000 0.82 0.2000000 0.5250000 0.2333333
3 Group3 0.1833333 0.760 0.74 0.2000000 0.2500000 0.2166667
4 Group4 0.3000000 0.820 0.66 0.2666667 0.1583333 0.2666667
5 Group5 0.2625000 0.545 0.76 0.2166667 0.1895833 0.2375000