Live data from Hacker News

Why do we use R rather than Excel?

shkspr.mobi

161–170 of 266 posts

Re: Why do we use R rather than Excel?

#161
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...

We never got the results of our covid tests from early in the pandemic because someone imported the medical data into Excel, which predictably and destructively modified the patient IDs by stripping all leading zeroes.

I've used perl, python, and R for scientific data for a really long time but have always made a concerted effort to avoid Excel. My reasoning feels the same as when people say Java is the best language because it can be run on any device, which is like saying anal sex is the best sex because you can do it with any animal.

Maybe I'm missing out on a great experience, but the notion has always made me uncomfortable.

Re: Why do we use R rather than Excel?

#162
post #146

Earlier quoted context omitted.

Do not shutdown the global economy. Just maybe move to tools with less issues around process governance: "The 7 Biggest Excel Mistakes of All Time" https://www.teampay.co/insights/biggest-excel-mistakes-of-al... "The financial fails and business risks of spreadsheets" https://www.webexpenses.com/2020/10/financial-fails-business... "Nightmare on spreadsheet: take Excel use seriously" https://www.icaew.com/insights/vie…

As though mistakes wouldn’t happen with non-programmers working in R.

In R, you can use accepted methods of software development and engineering, such as version control, automated testing, CI/CD to catch mistakes and prevent them from causing harm. In Excel? Not really.

Re: Why do we use R rather than Excel?

#163
if you need to do something, use python. if you need to do it while using complex math, use R. if you need to do it in real-time, use c. if you need to do it reliably with memory constraints, use ada. if you need it to work under arbitrary and difficult conditions and continually without pausing for weeks or years on end, use rust. for everything else, there is javascript.

Re: Why do we use R rather than Excel?

#164
post #40

If you need to do something once, use a GUI (Excel). If you need to do something ten times, use hotkeys and shortcuts. If you need to do something a hundred times, write a script (R). I usually use the command line as the example for why writing code and scripts are better than the more intuitive and lower-learning-curve GUIs. If I want to move a file from one folder to another then I just drag it across. Easy. If I…

I often write a script even if I only have to do something twice. In this case, the point is not to save time, it's to be secure in the knowledge that I did the thing in exactly the same way both times, because it was the same script that did it both times. (And then it saves time anyway, because it turns out I had to do the thing 20 more times after all.)

It’s not full proof, but the heuristic that your stakeholder will ask you for the same thing next week (or immediately ask you to do the same thing but slightly differently) has held pretty true for me

Re: Why do we use R rather than Excel?

#165
post #20

A while ago, there was a job offer in my area to automate Excel tasks using Python. The thing was posted time after time by several recruitment agencies, for almost a year. Just thinking how expensive that process must have been answers the question.

I've done this kind of conversion, not as a job, but on a case by case basis within my own work. An example would be taking a simple computation that I would share with people (mostly engineers) in the form of a spreadsheet, and instead turning it into a Python program, even replete with GUI. Here are some of the pitfalls that I've experienced. If I share a computation as a spreadsheet, people already know how to wor…

I’m doing this kind of task, and I tend to avoid any GUI and just have input and output files as simple text, CSV, or Excel spreadsheet. It seems to me that it’s the best way to have a satisfactory UX without too much headache.

Re: Why do we use R rather than Excel?

#166
post #70

Earlier quoted context omitted.

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?

For me, Excel is a tool mostly for entering data manually. In the case you described, it would be good for that purpose. I suppose you would have a column for each volunteer and then just enter data. Then you can read the file with python (pandas) and make a sum over the columns and give the one with most hours. Of course this case is also easy to do in Excel, however, the idea is that if you know more powerful tools (programming in general), then you will be able to do other things that otherwise you would regard as more time-consuming. Maybe you want then to give different awards for age ranges. And if you have too many volunteers then it would not be so easy any more in Excel, but in python you would just know how to do it.

Re: Why do we use R rather than Excel?

#167

Earlier quoted context omitted.

> I want to move a thousand files beginning with 'UTR-77' and ending with '.csv' 1. Use a file manager with stable sorting [1] (I use Thunar which does this, but I suspect lots of file managers keep the sort order stable). 2. Sort by type. 3. Sort by name. 4. Select the first file named UTR-77. 5. Scroll to the last file, and Shift+Click it. 6. Cut then paste to your desired directory. [1] - https://en.wikipedia.org/…

> 5. Scroll to the last file, and Shift+Click it. With thousands of files, this won't be particularly fast or easy.

If you know how to use a scrollbar, it is fast and easy. Grab the thumb and drag it down. If you overshoot or have trouble landing on the last file, use the page up/down areas of the scrollbar or its up/down arrow to fine tune the scroll position. Should only take a few seconds.

Another way is to hold down the Ctrl key and use the PgDn/PgUp keys to scroll. If you hold down Ctrl+PgDn you can whip through thousands of files quickly. Because you have the Ctrl key down, it won't affect your selection of the first file.

If all you know is two finger touchpad scrolling, then it will be very tedious.

Unfortunately, from observing a number of people - and apps that hide the scrollbars - it seems to me that two finger scrolling has largely taken over from scrollbar scrolling or the scroll keys.

Re: Why do we use R rather than Excel?

#169
post #6

Earlier quoted context omitted.

Honestly i struggle with it. My partner recently wrote an R package (phd biology) and I’m a developer. I had done a bit of R but nothing substantial. By the end of the project i couldn’t think of a compelling reason not to use any other language. The R tooling is clumsy, the language isn’t great…the built in graphs are ok? It feels like the reason it’s popular is mostly just people not wanting to update skills becaus…

I use R for work a lot, maybe to give some reasons to use R: 1. The language itself isn’t great, but the tidyverse packages are amazing. There’s really not a reason to use R if you’re not going to use tidyverse. 2. It’s integration to make quick webapps, books, Markdown reports, blogs. Is amazing. In a team where we process a lot in Excel, it’s so convenient I can just make a quick webapp that does that task a lot qu…

>There’s really not a reason to use R if you’re not going to use tidyverse.

I feel the same way, except for the data.table package.

Re: Why do we use R rather than Excel?

#170
I don't think there is any excuse for doing analysis in excel at this point, and if any analyst came to me with either a) no coding skills or b) no interest in developing them, I'd laugh them out of the room.

My BiL is this breed. He's a financial analyst. He's got a hilarious mental block about using any kind of coding language in his work to the point that he actually developed a web-scraping app in excel. Don't ask me how. But jimmeny-christmas, use the right too for the damn job.

Post reply on HN