I would recommend having a look at the plyr
package.
It might not be as fast as data.table or other packages, but it is quite instructive, especially when starting with R and having to do some data manipulation.
> DF <- data.frame(A = c("1", "1", "2", "3", "3"), B = c(2, 3, 3, 5, 6))
> library(plyr)
> DF.sum <- ddply(DF, c("A"), summarize, B = sum(B))
> DF.sum
A B
1 1 5
2 2 3
3 3 11