Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

unexpected behavior in reshape2:dcast() due to 'value_var' name change #16

Closed
jeffreybreen opened this Issue Feb 29, 2012 · 0 comments

Comments

Projects
None yet
1 participant

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

@hadley hadley closed this in dc55d5f Mar 10, 2014

@duncandoo duncandoo added a commit to duncandoo/reshape that referenced this issue Jun 23, 2014

@hadley @duncandoo hadley + duncandoo Useful error message if you use value_var.
Closes #16
b3fa41c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment