hadley/reshape — Issue #16: unexpected behavior in reshape2:dcast() due to 'value_var' name change
Author: jeffreybreen
Created: 2012-02-29 16:01:59+00:00
State: open

Hi Hadley:

I had some code, buried deep (of course), which stopped working when the 'value_var' parameter was renamed in dcast(). All fixed now, but the error message was not very helpful in tracking it down:

```
> crosstab = dcast(w.df, variable~value, value_var='V1', margins=T, fun.aggregate=sum)
Error in Summary.factor(integer(0), value_var = "V1", na.rm = FALSE) :
sum not meaningful for factors
```

It might be worth a line of code to accept and pass along 'value_var' to 'value.var' and/or issue a warning().

Just a thought,
Jeffrey