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...
While that is a very real problem, it isn't totally persuasive. It is just as easy to create traps in R (I lost days of my youth to R's challenging-to-defend jungle of an almost-type-system). It is even harder to debug than in Excel too - I would expect less bugs are found in R scripts because less people are up to the challenge of trying. People shouldn't do important work in Excel. If it is important, people should…
Why do we use R rather than Excel?
71–80 of 266 posts
Re: Why do we use R rather than Excel?
#72Big 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...
Actually when you use R functions to import CSV files, they also guess data types and make some conversions by default. The difference is that in R you can turn them off if you want to. But in Excel there are automatic changes you can't turn off.
Re: Why do we use R rather than Excel?
#73This 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…
This is the typical „CS-people“ reaction to learning R. R is a language written by statisticians for statisticians which can be a good but also a bad thing. Fact is that R is the lingua franca of statistics, most new methods will be first available in R, rarely in python, almost never in julia. Despite the superior design of julia, there are good reasons to still use R, for example, there are many state of the art li…
Re: Why do we use R rather than Excel?
#74Attempting to solve a complex analytical problems in Excel is similar to a doctor trying to solve medical problems by reference only to atoms.
Instead doctors use a variety of abstractions: organs, cells, enzyme, etc. to understand and explain a problem.
By using a programming language, we can develop appropriate abstractions to solve our problem in a way which keeps a lid on complexity.
I think this concept does make sense to an advanced Excel user, and can help explain the situations in which they may reach for a different tool. Having made some very complex Excel spreadsheets in the past, I think was aware it can become very difficult to develop them or generalise them further, even before I became a programmer.
Re: Why do we use R rather than Excel?
#75IMO 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…
Re: Why do we use R rather than Excel?
#76This 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…
I highly recommend anybody getting into R to skip the base language (which indeed is ancient and full of gotchas) and go straight for the Tidyverse[1]. You can always go back in and learn how to do things the old way later. Over the last decade, the R community has largely standardized around tools like dplyr, ggplot, tibble, purrr, and so on that make doing data science work way easier to reason about. Much more erg…
Re: Why do we use R rather than Excel?
#77Earlier quoted context omitted.
Actually when you use R functions to import CSV files, they also guess data types and make some conversions by default. The difference is that in R you can turn them off if you want to. But in Excel there are automatic changes you can't turn off.
You can set the data type to "text" when importing CSVs, that turns most things off.
Re: Why do we use R rather than Excel?
#78This 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…
1. Documentation is accessible via the interpreter. You can type ?funcname to get documentation or ?libname for the entry point for almost every library, or use the Help tab in RStudio, the most common interpreter. Package documentation is typically hyperlinked text and of a high quality. You can also see syndicated versions of library documentation online in HTML format. Here is for instance, the HTML documentation for the stats library (the built-in library which covers most of the statistical functions you want): https://stat.ethz.ch/R-manual/R-patched/library/stats/html/0... or rdocumentation.org or really any dozens of web syndicated versions. The PDF version you mentioned is linked from CRAN, the package repository, but is by no means the only entry point for documentation.
2. The print function -- actually not a single function, but rather a commonly implemented S3 method -- is easy to understand if you understand how the S3 object system in R works and how function dispatch works. What it does depends on the class of the object and whether an S3 print method has been implemented for the class of the object. This is true in most languages. If you're looking to something closer to a bare metal print function you should consider cat, but in general I don't find print confusing at all.
3. The subset operators available in R are documented. Because everything is a function in R, you can easily see the documentation by typing ?`[` or ?`[[` -- both have the same documentation page, which describes the essential difference between the two subsetting operators. This is tricky to learn at first but given that the two operators do different things, both desireable in different contexts, it's sort of difficult to argue this is an ergonomics issue and not a user error. If you want a more hands on discussion of the differences, you can try http://adv-r.had.co.nz/Subsetting.html
4. Assignment, similarly, is documented. You can check ?`=` if you have some concerns or read the documentation online here: https://stat.ethz.ch/R-manual/R-patched/library/base/html/as... The short version is that although and One final note: the inner workings of any R function for which the implementation is in R can be inspected. Simply type the name of the function and press enter to see the source code of the function. A lot of low level stuff is implemented in C, so you'll find a stub function that calls internal things, but for almost anything else, this is a good way to learn how things work. Like, run-length encoding is implemented in the rle function so just type rle and press enter and voila, you see the full implementation.
R has a number of core language issues and things that are annoying but the ones you named read like you puttered around for 10 minutes and didn't do the kind of basic homework you need to do to learn a new language. I wouldn't complain about what a bad language Go is because I don't understand the distinction between := and = as assignment operators.
Re: Why do we use R rather than Excel?
#79Wow those reasons don't sound very compelling to me! (I'm a programmer but don't know R.)
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 really like the R tooling. What do you find clumsy about it?
It feels like the reason it’s popular is mostly just people not wanting to update skills
I have the opposite view. I find its the people who complain about R because its a bit different are the ones who are inflexible about learning new skills.
Re: Why do we use R rather than Excel?
#80This 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…
I highly recommend anybody getting into R to skip the base language (which indeed is ancient and full of gotchas) and go straight for the Tidyverse[1]. You can always go back in and learn how to do things the old way later. Over the last decade, the R community has largely standardized around tools like dplyr, ggplot, tibble, purrr, and so on that make doing data science work way easier to reason about. Much more erg…
Avoid tidyverse like the plague, except when you can't, or when you don't actually care about the sanity of your code and are happy copy/pasting pre-prescribed snippets without needing to understand let alone modify them.