I have a *data.frame* in R in long format, and I want to cast it into wide.  

It has monthly data from several clients, and I want the final *data.frame* to have the mean per client of `he`, `vo`, `ep` and `fe`.  

`store` and `pr` should be fixed for each client.  

I think `dcast` from package `reshape2` should do the job, but I can't make it work. 

```
month   store   client  he  vo  ep  fe  pr
jan 1   54010   12  392 1   7   Basic
jan 2   54011   12  376 2   2   Premium
jan 1   54012   11  385 2   6   Basic
feb 1   54010   10  394 3   7   Basic
feb 2   54011   10  385 1   1   Premium
feb 1   54012   11  395 1   1   Basic
mar 1   54010   11  416 2   2   Basic
mar 2   54011   11  417 3   4   Premium
mar 1   54012   11  390 0   2   Basic
apr 1   54010   11  389 2   NA  Basic
apr 2   54011   7   398 6   3   Premium
apr 1   54012   11  368 1   3   Basic

```