Comments in line

On 13/03/2021 09:50, SOEIRO Thomas wrote:
Dear list,

I have some questions/suggestions about reshape.

1) I think a good amount of the popularity of base::reshape alternative is due to the complexity of 
reshape documentation. It is quite hard (at least it is for me) to figure out what argument is 
needed for respectively "long to wide" and "wide to long", because reshapeWide 
and reshapeLong are documented together.
- Do you agree with this?
- Would you consider a proposal to modify the documentation?
- If yes, what approach do you suggest? e.g. split in two pages?

The current documentation is much clearer than it was when I first started using R but we should always strive for more.

I would suggest leaving the documentation in one place but it might be helpful to add which direction is relevant for each parameter by placing (to wide) or (to long) as appropriate. I think having completely separate lists is not needed

2) I do not think the documentation indicates that we can use varying argument to rename variables in reshapeWide.
- Is this worth documenting?
- Is the construct list(c()) really needed?

Yes, because you may have more than one set of variables which need to correspond to a single variable in long format. So in your example if you also had 11 variables for the temperature as well as the concentration each would need specifying as a separate vector in the list.

Michael


reshape(Indometh,
         v.names = "conc",
         idvar = "Subject",
         timevar = "time",
         direction = "wide",
         varying = list(c("conc_0.25hr",
                          "conc_0.5hr",
                          "conc.0.75hr",
                          "conc_1hr",
                          "conc_1.25hr",
                          "conc_2hr",
                          "conc_3hr",
                          "conc_4hr",
                          "conc_5hr",
                          "conc_6hr",
                          "conc_8hr")))

Thanks,

Thomas
______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


--
Michael
http://www.dewey.myzen.co.uk/home.html

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to