3 ms·
>So if I have Zip codes with leading 0’s, use R? Several other software tools also mess up leading 0s including R if used in a naive way without specifying ext
by jasode 5y ago
>So if I have Zip codes with leading 0’s, use R?
Several other software tools also mess up leading 0s including R if used in a naive way without specifying extra options. My previous comment about this:
https://news.ycombinator.com/item?id=25017116 https://news.ycombinator.com/item?id=25017116
Like R, MS Excel can also preserve leading 0s -- if you specify the option on import. (Click on Excel 2019 Data tab and import via "From Text/CSV" button on the ribbon menu and a dialog pops up that provides option "Do not detect data types" (Earlier version of Excel has different verbiage to interpret numbers as text))
- user3939382 5y agoThe problem that I've had with this issue and Excel is that Excel performs overly-clever-automagic type conversions in certain situations where you don't want them. And then especially when you're collaborating on files with non-technical normal office workers, they're not expecting this behavior. So the end result has been that this issue has bitten me many times, despite knowing how to ideally tell Excel to handle it.