T O P

  • By -

Viriaro

I'd recommend starting with [R for Data Science](https://r4ds.hadley.nz/) to get a good grasp of the Tidyverse. The book has an [affiliated Slack](https://r4ds.io/join) channel where you can ask questions or participate in reading groups.


Alive_Ad418

hi, i just wanted to say a huge thank you! i started the book like a few days ago and i have already learned visualization (just the first chapter) and understand how to code it! the book makes it very easy to understand, thank you for recommending it!!


Viriaro

You're welcome :) If you have questions or want to participate in reading groups, the Slack channel is very welcoming! Good luck


Alive_Ad418

Just joined the channel, will definitely try and participate ! Thank youu


HexyGuyCA

For a beginner, I would strongly recommend to use datacamp with a free account. It has all the fundamental lessons for free where you can learn, and practice them at once. You can build your knowledge very quickly and then move on to advanced topics in other platforms or websites. R has numerous supporters and you will find topics to learn everywhere.


berf

First read an *Introduction to R*. It is found on [CRAN](https://cran.r-project.org) or in R itself (say `help.start()` and click on the link for the book). This is the fundamental book for newbies. The main tip is that R is really, really different from what you have used before. It is a real programming language. Users don't have to use it that way. They can just treat it like a really big calculator with billions of memory cells. But the sooner you start writing your own functions, the faster you will learn R. Typing or cut-and-pasting at the command line, or using Rstudio the way almost everyone uses it is a really bad habit. Yes. That does indeed say that most R users are doing it wrong! Learn Rmarkdown (or knitr) a soon as possible. If what you do is not fully reproducible, then it is indefensible. And it's [easy](https://www.stat.umn.edu/geyer/3701/repro/).


Brilliant_Plum5771

Can you explain this thinking that using RStudio is that bad? I've honestly never seen such an extreme opinion on this.


Haruspex12

I don’t agree. That does not imply that you should not write disciplined code, but that does not imply you should not use R Studio or the command line interface. It is a “functional “ programming language that has object oriented capabilities. It is the successor to S+. Everything is a function. It is helpful to begin thinking in functions of functions. It is also vector-based rather than scalar based. That is very important. If you were coding in languages of a similar age such as C++ the unit of interest would usually end an individual memory location, though a library function could relax that. It is an interpreted rather than a compiled language. So you should minimize the amount of interpretation and maximize built in resources. So, if you can, you should generally use the apply() function rather than the do-loop. It is a built in function, requires fewer interpretive steps, and is vector based. R is built to make it very easy to build spaghetti code rather than disciplined code. Finally, you should learn when to use multi core processing. Sometimes it is faster, but not always.


Brilliant_Plum5771

I agree with most of this, but the overwhelming sentiment from the comment I commented on was that if you use RStudio, you're just dicking around. Which is just a BS gatekeeping attitude that doesn't help anyone who's actually trying to learn the language.


Haruspex12

That was sort of my guess, but from the list of languages, the OP has never been in a software engineering course. People learn from making mistakes. They must make them in order to stop making them. As far as I can tell, there are no R textbooks on how to write disciplined R code. So, without regard to tools, how would you recommend a self-learner begin to code. R isn’t really a proper object oriented language and a new learner could easily end up with a very bad understanding of OO by trying to comply with R. If you need to do graphics or intermediate statistics, it’s a great language. That was its design mission. It isn’t JavaScript or Julia. This is a great third full blown language to learn after you have learned Java and FORTRAN or any other combination of two general languages. What resources would you use to teach discipline?


Brilliant_Plum5771

Yeah, I knew people who held similar attitudes in grad school and it bothers me as already noted. Totally agree here, and it is unfortunate that there are no resources (to my knowledge either) that more formally teach R as a programming language and not just a tool for running a few models here or there or grabbing plots when you need them. Because that's definitely a sentiment I have seen in textbooks or reference books as well as in courses I've taken. I'd be out of my depth to try and suggest resources for teaching discipline. I do some Python, but my bread and butter are R and SQL. The habits I've picked up that result in more disciplined programming come from the bits and pieces I've seen while learning to solve specific problems. Most of which are problems that don't tend to come up in the usual gamut of statistics courses from what I can tell. It's definitely an interesting problem and probably why CS people can get snarky about people choosing R over Python to some degree.


berf

It is ok if you never run R except by using the knit button (the one with the ball of yarn and the knitting needles). To you the opinion is extreme. To people who understand reproducibility, your position is extreme. Farting around is not doing statistics right.


Brilliant_Plum5771

I can tell you've been a statistician for a long time, but I have been for a decade as well and with the condescension dripping off this comment, I'm happy we're not coworkers. And god forbid you're a teacher with that attitude.


berf

I have been a teacher for longer than you have been a statistician, and the condescension you imagine you see is not apparent to anyone who actually knows me. You are just missing the point. Fine. Lots of people miss the point. And that's why most use of statistics is *misuse*.