mcaceresb / stata-gtools

Faster implementation of Stata's collapse, reshape, xtile, egen, isid, and more using C plugins
https://gtools.readthedocs.io
MIT License
182 stars 38 forks source link

Add suboptions for the option "uselabels" in GRESHAPE gather #58

Closed elektrotiko closed 5 years ago

elektrotiko commented 5 years ago

What would you like gtools to add or change (and why)?

This suggestion relates to an improvement of the "uselabels" option in greshape gather. I would like to recommend you adding an suboption to "uselabels" in order to exclude some vars from getting their variable labels as values instead of their var names. The reason is that we mostly would need to keep a track of both the previous varname and variable label.

Please include a specific suggestion

Add an suboption to uselabel to exclude some vars from the "uselabel" option. For instance, "uselabels (exclude, "thevarnameof_a_cloned_variable_of_the_one_being_reshaped"). Ensure that the list may contain multiple vars using asterisk.

Additional context Say that you have a variable that within its name contains a specific id code, i.e. "varname1_idcode_1234". I think we mostly need to keep this important information in a separate variable after reshape to be able to merge with additional vars.

mcaceresb commented 5 years ago

Up in develop; will merge to master in near future:

greshape gather, uselabels(varlist)
greshape gather, uselabels(varlist, exclude)
elektrotiko commented 5 years ago

Mauricio! You rock! You are one of the best developers when it comes to Stata plugins!