Live data from Hacker News

Learn R Through Examples (2020)

gexijin.github.io

41–50 of 68 posts

Re: Learn R Through Examples (2020)

#41

Lot's of negative comments in here about learning R from experienced programmers. I've found this is largely because experienced programmers have this unjustified bias that R is some toy language that should be easy to learn and has nothing to teach them. If you approached a language like Rust in the same way you would likely be just as frustrated with it. Certainly R has its quirks, but most of this comes from being…

What is the advantage of "thinking in vectors" in R versus "thinking in vectors" using numpy in Python (for example)?

Re: Learn R Through Examples (2020)

#42
Here is my take on R as a guy who does stats as well as some software engineering in more mainstream languages like Python.

R is a fantastic DSL for data manipulation and statistical analysis, with both traditional and modern tools, on datasets up to the gigabyte scale. It has great, easy-to-use data structures and unparalleled APIs in the tidyverse. It is not the thing for the latest deep learning implementation on petascale data, but most data science work doesn't need or benefit from that. Surprisingly, some machine learning methods have their nicest APIs in R, because that's where the users of those methods are.

It has its warts, but so do JavaScript and SQL, and I think few people dispute that these are very powerful DSLs. Statistical analysis is just as legitimate a computing task as building webpages or querying databases. It is not the same as general-purpose programming, and it needs a good DSL.

Re: Learn R Through Examples (2020)

#43

Lot's of negative comments in here about learning R from experienced programmers. I've found this is largely because experienced programmers have this unjustified bias that R is some toy language that should be easy to learn and has nothing to teach them. If you approached a language like Rust in the same way you would likely be just as frustrated with it. Certainly R has its quirks, but most of this comes from being…

Okay I’m not sure why R is getting a lot of Hate. After all its a programming language that gets the job done and its very popular in finacial industry especially among Risk Modelers, Quants and i have even seen this being used in analytics space within financial industry

Re: Learn R Through Examples (2020)

#44

Here is my take on R as a guy who does stats as well as some software engineering in more mainstream languages like Python. R is a fantastic DSL for data manipulation and statistical analysis, with both traditional and modern tools, on datasets up to the gigabyte scale. It has great, easy-to-use data structures and unparalleled APIs in the tidyverse. It is not the thing for the latest deep learning implementation on…

Agree with this. Nvim-R plus dplyr and the plotting libraries are the best tools I've found for manipulating and understanding the characteristics of a dataset quickly. Eventually I moved to Python for the specific reason that the R packages for interacting with cloud platforms couldn't really keep up with the development of those platforms, and I got tired of having projects that mashed together both languages. I haven't checked, maybe things have stabilized enough now that I would be happy going back to R.

Re: Learn R Through Examples (2020)

#45
post #23

Lot's of negative comments in here about learning R from experienced programmers. I've found this is largely because experienced programmers have this unjustified bias that R is some toy language that should be easy to learn and has nothing to teach them. If you approached a language like Rust in the same way you would likely be just as frustrated with it. Certainly R has its quirks, but most of this comes from being…

I find it highly unlikely that learning R will expand your programming views anywhere near Haskell. Haskell is an advanced functional programming language. Most R stuff seems to be incoherent, hard to verify correctness, hacky. It does not seem built on a solid foundation like Haskell. Truly everything being a vector is not a huge take away. As for "here's just a bunch of examples", well that seems sort of a brute fo…

This sounds like a highly biased perspective of both R, and what it means for a language to be respectable.

If you define a language that "will expand your programming views" as one that can verify correctness easily then yeah, R is terrible at that. But so are many languages that are as flexible as R. Would you have the same opinion of FORTH? Or LISP? or TCL? I think these languages definitely count as "hacky" languages and yet they don't seem to draw the same derision as R (in my experience)

Re: Learn R Through Examples (2020)

#46
post #3

If you already know another dynamic language and want to understand R, I would recommend skipping all the intros to R based around data analysis and start with Advanced R by Hadley Wickham. It will explain all the weirdness you'll encounter right up front before it confuses you. Then you can read the data analysis tutorials and focus on the content rather than the R weirdness.

I agree that Advanced R is a fantastic resource; however I do not think reading it is a good way to learn R. Advanced R explains the whys not the whats, and someone coming into R, who hasn't encountered any of the stuff Wickham gives intuitions for will likely find it an inexplicable truck of concepts.

Instead I would propose using R in some capacity, encountering it's weird quirks (why sometimes evaluating an expression prints something to console and sometimes it doesn't? How is dplyr using my column names as variables? Why do I get warnings when using & instead of &&?) And then turning to Advanced R as a source of sanity

Another source I would recommend is in fact the R language definition. It's very approachable and you quickly realize that R is pretty simple at the core, buried under piles of cruft

Re: Learn R Through Examples (2020)

#47
post #44

Here is my take on R as a guy who does stats as well as some software engineering in more mainstream languages like Python. R is a fantastic DSL for data manipulation and statistical analysis, with both traditional and modern tools, on datasets up to the gigabyte scale. It has great, easy-to-use data structures and unparalleled APIs in the tidyverse. It is not the thing for the latest deep learning implementation on…

Agree with this. Nvim-R plus dplyr and the plotting libraries are the best tools I've found for manipulating and understanding the characteristics of a dataset quickly. Eventually I moved to Python for the specific reason that the R packages for interacting with cloud platforms couldn't really keep up with the development of those platforms, and I got tired of having projects that mashed together both languages. I ha…

That makes sense. I don't much like crossing streams between languages on a project. It's great if you can keep R for analysis and Python for production, but if R can't keep up with the wrangling part, you're a bit up a creek. I'm lucky in that most of my analysis only needs to query fairly well-behaved SQL databases.

Re: Learn R Through Examples (2020)

#48
post #4

I consider myself a pretty experienced developer/software engineer/whatever. Decade into my career, started in iOS in Obj-C, learned Swift along the way, eventually migrated to the backend with Java/SQL, and finally found myself where I really wanted to be, embedded doing C/C++ work for a household name. That said, about halfway through my master's about two years ago, I found myself in an intro to data mining course…

> because apparently everything data mining/ML related in R is actually just python Everything? I'm just wondering what you've been doing exactly. I know that Tensorflow in R is just a wrapper on top of Python, not sure what else. If you're doing any deep learning, then going straight to Python is certainly much better than using R. For most other things it's not quite as clear of a decision.

Hilariously there's an argparse library for R, which has python as a dependency.

Re: Learn R Through Examples (2020)

#49
post #19

Lot's of negative comments in here about learning R from experienced programmers. I've found this is largely because experienced programmers have this unjustified bias that R is some toy language that should be easy to learn and has nothing to teach them. If you approached a language like Rust in the same way you would likely be just as frustrated with it. Certainly R has its quirks, but most of this comes from being…

Honestly, I'd argue that the issue I had in my experience in R wasn't that I myself wasn't giving it the respect it deserved, but rather that the course constructors for my degree didn't give it that respect. We were essentially told "Install R Studio, then just copy and paste these library imports and you're good to go". Your description of a vectorized language makes total sense, and that single paragraph is more o…

I wouldn't say this is true for "the majority user's of R" at all.

But for "the majority of professors who tangentially use R code in classes on statistics/bioinformatics/economics/finance (anything not explicitly about R and/or Data Science best practices)"? Absolutely.

The R code you see in industry (or academic labs where someone cares about modern R) looks vastly different from those script examples in college that are most people's first impression of the language.

Re: Learn R Through Examples (2020)

#50

R plus the tidyverse is what makes it a great language. Some tidyverse concepts are being baked into base R, like the pipe, but base R by itself feels hollow. R’s future is inseparable from the tidyverse. We need to just lump them together in any serious discussion of R. I teach a graduate level R course mainly for economics and statistics majors. (My educational background and career are computer science and technic…

Just for the record, many users are happy with base R. There are dozens of us!

R by itself is nice. But the tidyverse is creeping in and bringing dependency hell with it.

http://www.tinyverse.org/

Post reply on HN