I have this data frame. I would like to put each unique Dept and place the corresponding Name under each unique Dept. As you can see there are multiple Dept. For example, final dcoument should look like this:
Internet
Public-Web
Intranet
BackOffice
Batch
BackEnd
BackEnd
WebLogic
Oracle
dput(x)
structure(list(ID = c(1234L, 2345L, 6789L, 3456L, 7890L, 1987L
), Name = structure(c(5L, 3L, 2L, 1L, 6L, 4L), .Label = c("BackEnd",
"Batch", "Intranet", "Oracle", "Public-Web", "WebLogic"), class = "factor"),
Dept = structure(c(3L, 3L, 2L, 2L, 1L, 1L), .Label = c("BackEnd",
"BackOffice", "Internet"), class = "factor")), .Names = c("ID",
"Name", "Dept"), class = "data.frame", row.names = c(NA, -6L))
Any ideas how I would do this in R?