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

Informative message if no id.vars #38

Merged
merged 1 commit into from Mar 10, 2014

Conversation

Projects
None yet
2 participants
Contributor

tonytonov commented Jan 27, 2014

Sometimes there is a need to melt data "as is", i.e. with no arguments provided:

df <- data.frame(a=1:3, b=4:6)
melt(df)

The output is

Using  as id variables
  variable value
1        a     1
2        a     2
3        a     3
4        b     4
5        b     5
6        b     6

The message is not very informative and may be misleading. A small "if" handles this case, changing the message.

Owner

hadley commented Mar 10, 2014

I think I'd prefer "No id variables, using all as measured", since it parallels the other message a little better.

@hadley hadley added a commit that referenced this pull request Mar 10, 2014

@hadley hadley Merge pull request #38 from tonytonov/master
Informative message if no id.vars
c20dafe

@hadley hadley merged commit c20dafe into hadley:master Mar 10, 2014

1 check passed

default The Travis CI build passed
Details
Contributor

tonytonov commented Mar 12, 2014

Fine, thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment