Live data from Hacker News

Why do we use R rather than Excel?

shkspr.mobi

121–130 of 266 posts

Re: Why do we use R rather than Excel?

#121

Earlier quoted context omitted.

So if I have Zip codes with leading 0’s, use R?

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"?

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?

#122

Earlier quoted context omitted.

I mostly agree, but at least Excel is more easily inspectable by a human, which makes a certain class of errors (specifically, silly logic bugs) less likely to get through.

It's not obvious to me that Excel is more easibly inspectable, can you say more? To me, R seems more easily inspectable, as all the logic of a program is visible just by looking at text files, where in Excel it's hidden "under the surface", you have to click on cells, look at what's there, go click on other cells that relate to it, remember what you were looking at in the first one that's now invisible, etc.

It's the visualization of logic that I'm thinking of. You can press F2 on a cell and visually see what data is being pulled into the function, and you can easily manually check that that single calculation is accurate by re-creating that calculation by hand, and then infer that all the other stuff in the column is also accurate.

For anything very complicated though, I'd prefer R, as Excel eventually gets unwieldy. Although, I'm saying that from the perspective of being a reasonably experienced coder. The majority of the population should just use Excel, especially in a work context in non-technical teams. No matter how much you push for R, other people in the team aren't going to see the value and aren't going to go along with it, and your R code will be useless after you've left.

Re: Why do we use R rather than Excel?

#123

R isn't interactive or visual like Excel. Excel's learning curve is a lot less daunting. Also, Excel is ingrained in the accounting culture and well supported by peers. Plus Excel is everyone's default database and form software. None of the article's reasons matter to non-IT people and no IT department has the juice to override the CFO and accountants. Unlike, every other interactive tool that displeases programmers…

No, but it's far easier to see what the hell an R script is doing versus an Excel file. And there's just a ton more that R can do that Excel can't. More powerful plotting options, more tools like Random Forests or mixed effect models. And has less issues with floating point.

Excel is good for accounting tasks because that's what it and other spreadsheet software were originally designed for. Data science tasks are tacked on.

Re: Why do we use R rather than Excel?

#125
post #70

For non-programmers who do any kind of data processing, spreadsheet applications (Excel, Numbers, Google Sheets) are the closest thing to programming they have, and have a lot less overhead - just throw in the data, write a formula, you get results, no compilation or fidgeting with input and output and so on. The steps of an algorithm are reflected by cells that reference cells that reference cells. I've always thoug…

I've always thought that every highschooler should be taught the basics of programming with an easy language like Python instead. That really is a superpower in a lot more contexts.

Yes, but often different contexts.

Let's say my volunteer org wants to keep track of events, who volunteered in them, etc. and wants to give an award to the volunteer who gave the most hours. How do you do that in Python? Why would you?

Re: Why do we use R rather than Excel?

#126

Earlier quoted context omitted.

So if I have Zip codes with leading 0’s, use R?

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"?

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

Re: Why do we use R rather than Excel?

#127
post #53
post #4

Big big reason: R doesn't alter data without being asked to, Excel does so, silently, sneakily. Anything important should not be done in Excel. https://www.theverge.com/2020/8/6/21355674/human-genes-renam... https://stackoverflow.com/questions/165042/stop-excel-from-a...

Excel doesn't alter data without being asked either. What it does do by default is try to change how the data is displayed. If the column is properly set to the correct data type the data will be shown correctly because Excel doesn't change the actual data. Column types can be set when csv files are imported. The problem described in the article isn't an Excel issue. It is an issue of the geneticist failure to learn…

> Excel doesn't alter data without being asked either. What it does do by default is try to change how the data is displayed.

This is easily falsifiable. In a "general" cell, when I enter 0002, it gets changed into 2, not just in display, but in actual content. When I change the cell type to text, it'll still be 2. Only if I enter 0002 after changing the type to text is the content kept.

Similar when I want to have the text 3/17 or SEPT1 in a cell, I have to format it before typing or the data does get altered. If you try setting it to "text" after you typed it, you'll get some number that's not very useful to you.

Re: Why do we use R rather than Excel?

#128
I use R and Excel daily. Excels graphs are simpler to make than a customized GG plot, but an ice cream sandwich is easier than a sundae with whipped cream and sauce and a cherry.

Different levels of difficulty and customization for different applications.

Re: Why do we use R rather than Excel?

#129

This week I got a bit more familiar with R while adding it as a scripting language for a data IDE I'm working on (it already supported other languages). It is a very hard language and community to get into! The documentation is very sparse. Library documentation is published as PDF (I guess?) and also very sparse. The default `print` behavior is pretty hard to understand. It's 1-indexed and it took me a while to real…

Use the tidyverse and use the cheatsheets for dplyr and the book R for Data Science. If you're trying to use primarily base R, you'll be limited and hamstrung. Tidyverse is the modern framework of choice.

Re: Why do we use R rather than Excel?

#130
post #96

For non-programmers who do any kind of data processing, spreadsheet applications (Excel, Numbers, Google Sheets) are the closest thing to programming they have, and have a lot less overhead - just throw in the data, write a formula, you get results, no compilation or fidgeting with input and output and so on. The steps of an algorithm are reflected by cells that reference cells that reference cells. I've always thoug…

> it really is a superpower in many contexts. It's a trap because once you get comfortable in Excel you have a lot of resistance to try anything more productive than Excel. Seen that numerous times with people who work really fast with Excel yet end up very limited as to what they can actually deal with beyond simple problems.

Depends, I worked for a few life science companies and was quite surprised with the VB adoption.

Basically it grew out of the fact that many of these companies are focused on Windows, given the software of the data readers and laboratory robots.

So it is quite common to have Visual Studio licenses around.

A common pattern for the history of many VB packages I found out across the business units, was software that started in Excel, alongside VBA macros, and eventually was ported into VB.

Post reply on HN