Hmisc icon indicating copy to clipboard operation
Hmisc copied to clipboard

do not export 'recode'

Open rubenarslan opened this issue 11 years ago • 7 comments

If recode is an internal, undocumented function in Hmisc as it appears to be, it shouldn't be exported, especially considering it overwrites the more widely used car::recode. E.g. http://stackoverflow.com/questions/9337716/how-do-i-use-functions-in-one-r-package-masked-by-another-package https://stat.ethz.ch/pipermail/r-help/2010-June/242466.html

rubenarslan avatar Dec 05 '13 16:12 rubenarslan

recode is not an internal function, and is exported by Hmisc, 15 years before the existence of car. The bigger question is whether anyone is still using Hmisc's recode, i.e., whether it should stay in the package.

harrelfe avatar Dec 05 '13 16:12 harrelfe

Since it's undocumented and bringing up its help dialog gives us "These are not to be called by the user or are undocumented." I doubt many casual users dare use it.

rubenarslan avatar Dec 05 '13 16:12 rubenarslan

Good point; didn't remember I had never written a help file. Will remove from the package for the next version.

harrelfe avatar Dec 05 '13 16:12 harrelfe

Thanks! This was my first R gotcha and it still trips me up sometimes :-)

On 05 Dec 2013, at 17:58, Frank Harrell [email protected] wrote:

Good point; didn't remember I had never written a help file. Will remove from the package for the next version.

— Reply to this email directly or view it on GitHub.

rubenarslan avatar Dec 05 '13 17:12 rubenarslan

I do use it directly (usually with Hmisc:::recode after loading car second) and its disappearance bit my legacy code today. Found it in the prior code (https://github.com/harrelfe/Hmisc/blob/3cf7fce26cc1bf9728fdfc67164b5e24bf6bb7bc/R/recode.s) - agree that removing it (or renaming it) is probably best because it clashes with car so often even though you came first!

bbbruce avatar Sep 09 '14 13:09 bbbruce

The removal of this function was announced earlier in the NEWS file.
You can find it in older versions of the package or I can send it to you if needed. Frank

On 09/09/2014 08:46 AM, Beau Bruce wrote:

I do use it directly (usually with Hmisc:::recode after loading car second) and its disappearance bit my legacy code today. Will find it in the prior code...

— Reply to this email directly or view it on GitHub https://github.com/harrelfe/Hmisc/issues/1#issuecomment-54970821.


Frank E Harrell Jr Professor and Chairman School of Medicine

Department of *Biostatistics*   *Vanderbilt University*

harrelfe avatar Sep 09 '14 14:09 harrelfe

Thanks - I found it - just commented since the issue was still open (even though I gather it is closed - in a fashion I agree with). Thanks for your help - I love Hmisc and rms.

bbbruce avatar Sep 09 '14 14:09 bbbruce