I have this data frame:
我有这个数据框架:
Date Company Region Units
1 1/1/2012 IBM America 10
2 1/1/2012 IBM Europe 4
3 1/1/2012 IBM Pacific 2
4 1/1/2012 HP America 10
5 1/1/2012 HP Europe 2
6 1/1/2012 Gateway Americas 2
7 1/2/2012 IBM Americas 10
8 1/2/2012 HP Europe 2
9 1/12/2012 Gateway Americas 10
dput(x)
structure(list(Date = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 3L,
3L, 2L), .Label = c("1/1/2012", "1/12/2012", "1/2/2012"), class = "factor"),
Company = structure(c(3L, 3L, 3L, 2L, 2L, 1L, 3L, 2L, 4L), .Label = c(" Gateway",
" HP", " IBM", " Gateway"), class = "factor"), Region = structure(c(3L,
5L, 6L, 1L, 2L, 7L, 4L, 2L, 7L), .Label = c(" America",
" Europe", " America", " Americas",
" Europe", " Pacific", " Americas"), class = "factor"),
Units = c(10L, 4L, 2L, 10L, 2L, 2L, 10L, 2L, 10L)), .Names = c("Date",
"Company", "Region", "Units"), class = "data.frame", row.names = c(NA,
-9L))
Dat