Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output format of reshape functions #645

Closed
garborg opened this issue Jul 8, 2014 · 7 comments · Fixed by #2147
Closed

Output format of reshape functions #645

garborg opened this issue Jul 8, 2014 · 7 comments · Fixed by #2147
Labels
breaking The proposed change is breaking.
Milestone

Comments

@garborg
Copy link
Contributor

garborg commented Jul 8, 2014

@tshort I got familiar with the reshape functions in #644, and had a couple questions about the output format:

  1. Placing the id vars to the right of the measure vars -- seemed the opposite of what I'd used elsewhere -- what's the rationale?
  2. Trivial: lowercase variable and value -- are they just from before the uppercasing idiom took hold, or is it a reducing clashes / purposely stand out thing?
julia> d = dataset("reshape2", "smiths")
julia> melt(d, [:Subject, :Time], [:Age, :Weight, :Height])
6x4 DataFrame
|-------|----------|-------|--------------|------|
| Row # | variable | value | Subject      | Time |
| 1     | Age      | 33.0  | "John Smith" | 1    |
| 2     | Age      | NA    | "Mary Smith" | 1    |
| 3     | Weight   | 90.0  | "John Smith" | 1    |
| 4     | Weight   | NA    | "Mary Smith" | 1    |
| 5     | Height   | 1.87  | "John Smith" | 1    |
| 6     | Height   | 1.54  | "Mary Smith" | 1    |
@tshort
Copy link
Contributor

tshort commented Oct 10, 2014

Sorry I missed this @garborg. I'm fine with both of your suggested changes.

@bkamins bkamins mentioned this issue Jan 15, 2019
31 tasks
@bkamins bkamins added the breaking The proposed change is breaking. label Feb 12, 2020
@bkamins bkamins added this to the 1.0 milestone Feb 12, 2020
@bkamins
Copy link
Member

bkamins commented Feb 12, 2020

We need to decide on this before 1.0 release

@bkamins
Copy link
Member

bkamins commented Mar 7, 2020

@nalimilan - I would close it. These changes would be breaking and do not improve things significantly enough to justify it I think.

@nalimilan
Copy link
Member

Maybe let's just add columns to the end instead of the beginning? That's what the tidyverse (both reshape2 and tidyr) and Pandas do, and it shouldn't break a lot of code anyway since names are more common to use than positions.

@bkamins
Copy link
Member

bkamins commented Mar 7, 2020

So we switch to: id, variable, value order?

@bkamins
Copy link
Member

bkamins commented Mar 8, 2020

If yes I will implement this after #2140 is merged (because a lot of documentation will get updated)

@nalimilan
Copy link
Member

Yes that sounds like the common order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking The proposed change is breaking.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants