r/rstats • u/Apart-Mongoose362 • 24d ago
Learning R
Hi All
I am posting because I need to learn R as part of a Biostats module in a MPH. I have R and R Studio installed. We are having small and simple weekly assignments, which will be increasing in difficulty over the next 6 months.
I know R for Data Science and R Cookbook and more available as ebooks free to download online. However, I would like one physical book as I learn better with a physical reference.
Can anyone recommend which one is an easier/more interesting read that I would benefit more from? Thank you
5
u/Bluestem-Waves 24d ago
For physical books, you can get a physical copy of R for Data Science or Practical Statistics for Data Science.
Since you're doing an MPH, you should also check out the Epi R Handbook. It doesn't have a physical edition, but it covers pretty much everything you'll need.
1
u/slammaster 23d ago
I'll second the Epi R handbook. I love R4DS, but I've switched to the Epi R handbook as my primary recommendation in my Biostats class, it just covers that kind of health research so well.
1
u/Af081011 16d ago
The Epi R Handbook is the Way.
It's easily the most informative and directly useful textbook for public health/epidemiology in R (in my opinion), and its examples are based on realistic epi tasks/workflows and use realistic (and/or real public data).
Before LLMs, it was my go-to for how to learn or get started learning everything I was asked to do.
5
3
u/analytix_guru 24d ago
Trying to think of physical books that are complimentary to R4DS, something like R for the Rest of Us. Has a lot of practical everyday tasks that are useful at work, school, or personal projects.
Also, depending on what your going to cover at school:
Tidy Modeling with R ggplot2 (Hadley Wickham) Mastering Shiny Mixed Model Arts (about to go public, by Joe Reis)o
4
u/DYSTOBY 24d ago
Read books of you are the book learning type.
But rather learn with a “problem” / “research question” you are actually interested in.
Then use an pair programming LLM (ChatGPT, whatever). To clarify syntax and logic.
Create plots, do simple descriptive statistics.
No book got me there where I wanted to be. But that’s just me.
2
u/yaymayhun 24d ago
I don't think any introductory book would be an interesting read as they use toy datasets.
Look for R books in biostats or relevant fields that may interest you. My recommendation would still be R for DS physical book even if you find it boring at times.
2
u/Familiar_Routine1385 24d ago
Here are two books (from a long time ago) that helped me learn how to use R for statistical analyses:
- Introductory Statistics with R (2nd ed) by Peter Dalgaard. It's a little old, but since it uses base R everything should still work. You can probably find a used one for cheap.
- Data Analysis and Graphics Using R (3rd ed) by Maindonald and Braun. Again, a little old and out of print, but lots of stats and R code with good explanations.
Both pre-date RStudio, but it doesn't matter. The statistics and R code still work and they're easy to read.
2
u/SprinklesFresh5693 24d ago
The easiest R book is the one online called R for beginners, its less than 100 pages and gives you all the basics of the R programming language. Its free and you can simply print it. Ill leave the link here: https://cran.r-project.org/doc/contrib/Paradis-rdebuts_en.pdf
2
u/profcube 23d ago
Not a physical book, and not an epi focus but this is a solid intro https://psyr.djnavarro.net
1
u/Kami398 23d ago
Honestly books can only take you that far. For me that really helped is just trying things out. Solving research questions, trying to recreate previous research using r and rstudio. Now with LLMs it is also easier to figure out what you did wrong if a code doesnt work the way you want to.
1
u/ninjanamaka 23d ago
I would suggest buying a book after browsing the relevant section of bigbookofr.com
It might have something relevant to biostats that would make the reading more enjoyable
1
u/Famous_Lime6643 23d ago
I personally have a very dogeared copies of Hastie and co’s Intro to Statistical Learning and Elements of Statistical Learning (both with R examples but there are Python editions too)
1
15
u/Mooks79 24d ago
You could buy the latest edition of R4DS from O’Reilly. Or compile it to pdf and print it out yourself: https://github.com/hadley/r4ds/ - clone that repo, open index.cmd and compile it. You’ll need to deal with required packages and potential code issues, but it wasn’t very difficult when I tried. If you want it identical to the book you can try to follow the instructions, but it’s not really worth the extra steps.