News for hackers. Stuff that matters.
Re:Why do we use R rather than Excel? by user3939382 on Sunday July 11, 2021 @09:48AM (#27800756)
So if I have Zip codes with leading 0’s, use R?
Re:Why do we use R rather than Excel? by jasode on Sunday July 11, 2021 @09:55AM (#27800808)
>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

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))

Re:Why do we use R rather than Excel? by user3939382 on Sunday July 11, 2021 @12:12PM (#27802034)
The 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.
Re:Why do we use R rather than Excel? by shawnz on Sunday July 11, 2021 @10:39AM (#27801171)
If you have zip codes, don't store those in a numeric type (doesn't matter if it's Excel, R, or any other system)

Zip codes aren't numbers, they are strings that happen to contain only numeric characters

Re:Why do we use R rather than Excel? by TeMPOraL on Sunday July 11, 2021 @10:40AM (#27801185)
WAIT. All these words on SO and here have been written because people don't know to change the column type from "General" to "Text"?
Re:Why do we use R rather than Excel? by Linosaurus on Sunday July 11, 2021 @10:46AM (#27801244)
They would like to be able to just open a csv file in excel without going through a file import wizard. Changing the column type after the fact is too late.
Re:Why do we use R rather than Excel? by intended on Sunday July 11, 2021 @10:57AM (#27801335)
If you get to the point that you are using r and python, it should be because you are doing working with larger data sets, or it’s specifically sophisticated.

If you can learn a language, you could constrain type conversions easily once you have for knowledge.

Its not like there aren’t painful gotchas in other tools- it’s an issue if you aren’t aware of them and if they impact your work.

If it’s big, unusually complex, you probably want a DB before analysis.

If it’s repetitive, or advanced modeling/ml: python/r