IMO this really asks the question: Why is there not a code view for an excel spreadsheet? I get that some of the basic operations probably create expressions that are too wordy / very "specific data" intensive. That is, if you took the first step and just did your best to create that code view it would have a lot of stuff conditional on specific things. But it's the next step that gets interesting. Now that you've go…
You might want to try out Power Query (get & transform). Step-by-step repeatable transformations where the UI records steps and writes code in the background. Almost exactly what you're talking about, and comes out-of-the-box in the last few versions.
Why do we use R rather than Excel?
31–40 of 266 posts
Re: Why do we use R rather than Excel?
#32A 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 actually really enjoyed it, there's something a bit magical about taking a task that takes somebody hours to do, and putting it under a single button press, or even running it overnight and having everything ready for them when they start work the next day.
Re: Why do we use R rather than Excel?
#33It 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 realize every time I think `array[1]` I should write `array[[1]]`. I can't tell the difference between `My guess is that it was probably a great language at some point but is way behind other numeric scripting languages like Julia or Matlab in terms of community attention and language ergonomics.
I know it's highly used but other than legacy reasons I'm not sure why you'd want to learn it over Julia.
I'm also curious to investigate how the aspects I'm critical of differ in Octave.
Edit: totally fair, 1-indexing shouldn't have been a "critique". Lots of languages do that.
Re: Why do we use R rather than Excel?
#34IMO this really asks the question: Why is there not a code view for an excel spreadsheet? I get that some of the basic operations probably create expressions that are too wordy / very "specific data" intensive. That is, if you took the first step and just did your best to create that code view it would have a lot of stuff conditional on specific things. But it's the next step that gets interesting. Now that you've go…
The MS Excel grid with code underneath each cell is declarative (not iterative loop) formulas so what would the ideal "code view" be?
Because of the architecture based on formulas, Excel does already have "Show Formulas" option (keyboard shortcut Ctrl+`) and "Trace Precedents" and "Trace Dependents".
For Excel iterative code like VBA Macros, it does have a typical "code view" (keyboard shortcut Alt+F11).
Re: Why do we use R rather than Excel?
#35Re: Why do we use R rather than Excel?
#36IMO this really asks the question: Why is there not a code view for an excel spreadsheet? I get that some of the basic operations probably create expressions that are too wordy / very "specific data" intensive. That is, if you took the first step and just did your best to create that code view it would have a lot of stuff conditional on specific things. But it's the next step that gets interesting. Now that you've go…
>Why is there not a code view for an excel spreadsheet? The MS Excel grid with code underneath each cell is declarative (not iterative loop) formulas so what would the ideal "code view" be? Because of the architecture based on formulas, Excel does already have "Show Formulas" option (keyboard shortcut Ctrl+`) and "Trace Precedents" and "Trace Dependents". For Excel iterative code like VBA Macros, it does have a typic…
Re: Why do we use R rather than Excel?
#37Wow those reasons don't sound very compelling to me! (I'm a programmer but don't know R.)
Re: Why do we use R rather than Excel?
#38Re: Why do we use R rather than Excel?
#39What that means to me is that I use excel for "toys" (small data set analysis, rough charts) and ephemeral-yet-shared lists where it is easier to say "evening batch tab, line 3" to communicate which job needs to be updated than try to communicate the same thing in a written request or pull a database table report.
I use R where I need more power: automated reports, automated statistics, and more complex analysis where the paradigm of textual code fits better than the paradigm of a 2D grid. I teach R (or python) when I want to give someone more reproduceable tools than a "magic" spreadsheet that, under the covers, is really a contraption held together with sticky tape and positive thinking.
We can, and should, teach both. Ideally side-by-side with a constant stream of "why are you doing task X this way?" that is largely missing from formal education.
Re: Why do we use R rather than Excel?
#40If 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 want to move a thousand files from one folder to another, I will benefit from learning `CTRL-A` or shift-clicking (slightly more obscure than the 'intuitive' drag each file across individually or drag a large box around them all to select them).
If I want to move a thousand files beginning with 'UTR-77' and ending with '.csv' then I would benefit from learning `mv UTR-77*.csv $folder`, but I could still do it manually if I didn't know that was an option.
If I want to move a thousand files beginning with 'URT-77' to another folder at a moment's notice or at Thursday 1am, then the only options I really have are scripting.
I almost feel like before people learn the 'basic' stuff as outlined at the beginning of the article, they should be shown some 'magic' that is only really possible with scripting so that it's clear from the outset why you wouldn't 'just use excel'.