Earlier quoted context omitted.
Exactly. A little {insert favorite language} snippet is immediately inspectable, also weeks or months or years in the future.
You underestimate my ability to write code that I myself can’t make sense of years (or sometimes even months or weeks) in the future.
Why do we use R rather than Excel?
231–240 of 266 posts
Re: Why do we use R rather than Excel?
#232Earlier quoted context omitted.
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.)
This is spot on! I think sometimes if you do same thing 3 times it is already better to script it, unless you are sure that no further modifications will take place. Scripting will ensure reproducibility and it is invaluable when you can follow your logic later when you already forgot how you come up with that chart.
Re: Why do we use R rather than Excel?
#233If 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…
Re: Why do we use R rather than Excel?
#234Earlier quoted context omitted.
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
if you're doing something once and once only, maybe it's a candidate for the manual or gui way.
if you think you might do it twice, it's almost certainly time to automate or start programming it.
Anything encountered in business that you encounter more than 1 time is likely to be encountered N times more.
Re: Why do we use R rather than Excel?
#235If 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…
In far manager (freeware, open source) and total commander (commercial, not too expensive, trial available), numpad `+` key open “expand selection” popup, where you can type “utr-77.csv”, and it will select just these files.
Unlike the command line, you can inspect what had been selected before moving these files. You can also use insert/numpad +/numpad - keys to modify the set of files going to be moved/copied/deleted/zipped/etc.
Most file systems and file managers don’t have undo support. It can be important to review what going to happen before actually moving any files.
Re: Why do we use R rather than Excel?
#236Re: Why do we use R rather than Excel?
#237This is also how it works in Power BI, but I guess it's a bit of a different way of working than how most people are used to work.
Re: Why do we use R rather than Excel?
#238Earlier quoted context omitted.
> If I want to move a file from one folder to another then I just drag it across. Easy. Even this is easier with scripting, especially if you're already used to thinking in wildcards and tab-completion. Scrolling, hunting for files, dragging, clicking: these are inherently clumsier and slower steps, optimized for new-user intuitiveness and simplicity over efficiency. The upfront investment of making your brain think…
For those who haven't used it, ctrl-r in the command line is the best thing in the world. It does a reverse-search over previous commands. Set your max history size to unlimited, and your CLI will remember /all/ commands you ever type, making it very easy to find long, strange incantations that you figured out once, so long as you can remember some small part of the command. For example, How did I do that magical ffm…
Re: Why do we use R rather than Excel?
#239Earlier quoted context omitted.
> If I want to move a file from one folder to another then I just drag it across. Easy. Even this is easier with scripting, especially if you're already used to thinking in wildcards and tab-completion. Scrolling, hunting for files, dragging, clicking: these are inherently clumsier and slower steps, optimized for new-user intuitiveness and simplicity over efficiency. The upfront investment of making your brain think…
For those who haven't used it, ctrl-r in the command line is the best thing in the world. It does a reverse-search over previous commands. Set your max history size to unlimited, and your CLI will remember /all/ commands you ever type, making it very easy to find long, strange incantations that you figured out once, so long as you can remember some small part of the command. For example, How did I do that magical ffm…
I’ve got a bunch of saved notes with various incantations that would become redundant if so!
Re: Why do we use R rather than Excel?
#240For 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.