For a analysis I would like to transform data from:
data <- data.frame(
  Customer = c("A", "A", "B", "B", "C", "C", "C"),
  Product = c("X", "Y", "X", "Z", "X", "Y", "Z"),
  Value = c(10, 15, 5, 10, 20, 5, 10)
)
data
#   Customer Product Value
# 1        A       X    10
# 2        A       Y    15
# 3        B       X     5
# 4        B       Z    10
# 5        C       X    20
# 6        C       Y     5
# 7        C       Z    10
To:
Product Product Sum Value
-------|-------|---------
X      |Y      |50
X      |Z      |45
Y      |Z      |15
Basically I want to get the sum of the value for every product combination within a customer. I guess it could work with some help of the reshape package but I cannot get it to work.
Thanks for your time.
 
    