r/rprogramming • • Nov 14 '20

educational materials For everyone who asks how to get better at R

748 Upvotes

Often on this sub people ask something along the lines of "How can I improve at R." I remember thinking the same thing several years ago when I first picked it up, and so I thought I'd share a few resources that have made all the difference, and then one word of advice.

The first place I would start is reading R for Data Science by Hadley Wickham. Importantly, I would read each chapter carefully, inspect the code provided, and run it to clarify any misunderstandings. Then, what I did was do all of the exercises at the end of each chapter. Even just an hour each day on this, and I was able to finish the book in just a few months. The key here for me was never EVER copy and paste.

Next, I would go pick up Advanced R, again by Hadley Wickham. I don't necessarily think everyone needs to read every chapter of this book, but at least up through the S3 object system is useful for most people. Again, clarify the code when needed, and do exercises for at least those things which you don't feel you grasp intuitively yet.

Last, I pick up The R Inferno by Pat Burns. This one is basically all of the minutia on how not to write inefficient or error-prone code. I think this one can be read more selectively.

The next thing I recommend is to pick a project, and do it. If you don't know how to use R-projects and Git, then this is the time to learn. If you can't come up with a project, the thing I've liked doing is programming things which already exist. This way, I have source code I can consult to ensure I have things working properly. Then, I would try to improve on the source-code in areas that I think need it. For me, this involved programming statistical models of some sort, but the key here is something that you're interested in learning how the programming actually works "under the hood."

Dove-tailed with this, reading source-code whenever possible is useful. In R-studio, you can use CTRL + LEFT CLICK on code that is in the editor to pull up its source code, or you can just visit rdrr.io.

I think that doing the above will help 80-90% of beginner to intermediate R-users to vastly improve their R fluency. There are other things that would help for sure, such as learning how to use parallel R, but understanding the base is a first step.

And before anyone asks, I am not affiliated with Hadley in any way. I could only wish to meet the man, but unfortunately that seems unlikely. I simply find his books useful.


r/rprogramming • • 14h ago

Plot curves for coxph frailty model

2 Upvotes

Hello I am asking if anyone is aware of how to draw adjusted cum hazard and survival curves after running a frailty model using coxph. I am using the Surv(start, stop ,event status) framework with gap times. Importantly, I have had to stratify a binary variable as it violated the proportional hazards assumption - using strata(var). The goal is to do curves for the overall sample (showing the two strata), and then separately for each individual variables. I have an interaction and it would be good to plot the hazards of 1 variable versus the actual values of the other variables. Any guidance, particularly code implementation, of this would be very helpful.

I am a clinician and not a statistician, but also not trying to use AI at all as Im against it and dont want to have to use it and then declare it.

I am aware of other setups for example cluster() option for robust standard errors as well as frailtypack, coxme, etc. The curves could be drawn in easily with the cluster() option. However, the research question very much needs a frailty model. Also Ive written out the whole thing based on the frailty findings and Kaplan Meier curves...the findings dont necessarily remain with other modelling options which is a problem.


r/rprogramming • • 3d ago

ADS programmer at Genentech USA

Thumbnail reddit.com
0 Upvotes

r/rprogramming • • 13d ago

R language help

0 Upvotes

I HAVE AN URGENT HELP NEEDED WITH THE R SOFTWARE. ANYONE WHO IS A PRO AT IT PLS CONTACT ITS A CODE RED SITUATION!!

thx <3


r/rprogramming • • 22d ago

Inserting csv/excel file

0 Upvotes

Hi im fairly new to r and trying to import excel files I have all the steps down with working directory but it says the file doesn't exist yet list.files() tells me its in the working directory and that the working directory I used was put in idk whats wrong with it can anyone help


r/rprogramming • • 26d ago

The fastest backtester you’ve never heard of is built in plain R

Thumbnail blechturm.com
1 Upvotes

r/rprogramming • • 28d ago

J'ai fait un point-and-click de campagne présidentielle 2027 dans un seul fichier HTML (et ça tourne nickel sur mobile)

0 Upvotes

J'ai sorti un jeu d'aventure point-and-click satirique sur la présidentielle 2027. Le truc pratique, c'est que ça tient dans un seul fichier HTML/JS : zéro installation, ça tourne direct dans le navigateur et l'interface est super bien adaptée/responsive sur mobile.

C'est dans l'esprit des vieux jeux LucasArts (interface à verbes, inventaire, dialogues à choix). En gros : tu gères ta campagne, tes électeurs et les galères médiatiques.

C'est totalement gratuit : https://vigone.github.io/destinationelysee2027/

Curieux d'avoir vos retours si vous testez !


r/rprogramming • • Oct 24 '26

I am unable to learn R and just rely on AI. Suggestions please?

0 Upvotes

Hello,

I have tried to learn R inside Rstudio and even did a course on the basics. I'm now in a role where they are encouraging me to learn R while doing it, but I am unable to do it all because I am unable to understand the sequence of steps and feel AI vibe coding is better option since I don't know if I'm doing things the right way and prompting AI for each step is confusing because I miss out steps which I should have added. Coding with AI is also better since I have deadlines at work. I know this is not the best thing for my own sake, and wish to learn R badly, but nothing seems to be working.

I have struggled with math in a similar way as a kid until I was able to understand the way it works, and now I love math. Sadly I don't have a teacher to teach me r now, but I really and desperately want to learn to code in R, especially in the next couple of days. I'm willing to put in the time to learn, but I need something which helps me make better sense of the language, in a way which is easier to understand and quick too. All suggestions and advice are welcome.


r/rprogramming • • Oct 20 '26

Feeling stuck trying to transition from Data Analyst to Statistical Programmer

Thumbnail reddit.com
0 Upvotes

r/rprogramming • • Oct 17 '26

J'ai créé une extension VS Code pour Git parce que j'en avais marre des push --force accidentels.

Thumbnail
github.com
0 Upvotes

r/rprogramming • • Oct 13 '26

[Software] SimtablR: Quick and Easy Epidemiological Tables, Diagnostic Tests, and Multi-Outcome Regression - version 3 now available on CRAN!

Thumbnail reddit.com
0 Upvotes

r/rprogramming • • Sep 29 '26

Code visualization graph for teaching and code review

2 Upvotes

Hi everybody,

I am an R enthusiast and a coding professor in my school.

Through the years I have been building a mental model of the structure of a program and how the different components interacts with each other and I wanted to build a tool for that.

The concept is simple: each code entities will be a node in the graph, and will have different kinds of edges that connect them. One can explore the graph by expanding a node through it's potential connections (which other bloc of code it calls, wich part is coupled, the potential types, etc.). One could even enter the block by double-clicking and see it's internal as another graph of private nodes.

This project could help my students understand better some programming principle and could even help programmers for code review.

What do you think?


r/rprogramming • • Sep 21 '26

Best place to learn R programming

24 Upvotes

Hi...I am new to R programming....I want to learn about R programming....where to start and how....


r/rprogramming • • Sep 11 '26

Make your maftools plots interactive with MutGlyph

4 Upvotes

A colleague of mine recently made an R package called MutGlyph, and I thought it might be worth sharing here.

It’s mainly aimed at bioinformaticians, but given how heavily R is used in genomics, I figured there’s probably a decent overlap with this sub.

The basic idea is to take familiar cancer-genomics plots and make them interactive. You can build things like oncoplots, lollipop plots, rainfall plots, and GISTIC copy-number landscapes, then zoom, pan, hover, and inspect dense regions instead of being stuck with a static figure.

It uses GenomeSpy underneath, but from the R side it behaves like a normal package and works with familiar maftools objects and workflows.

The API is intentionally very close to maftools, so you can swap a static plot for an interactive one with miniscule code change :)

GitHub: https://github.com/genome-spy/MutGlyph/
Docs: https://genomespy.app/MutGlyph/

example oncoplot (it's actually interactive but couldn't post a video here)

r/rprogramming • • Sep 10 '26

Use case in the insurance sector

0 Upvotes

Hello,

Next month I will be start working as a part-time student at a big insurance company in market analysis/research. One of the requirements in the job posting was "basic knowledge in R or a willingness to learn it".

When asked in the interview, I said I am familiar with the interface, used it in a few classes at uni (regression analyses, creating plots). I have never used it for projects or anything and I mostly just followed what was taught.

I am now doing a few beginner courses on DataCamp. What sort of things should I know and does anyone have an idea on how R could be used in this sector?

Thank you :)


r/rprogramming • • Sep 03 '26

RDesk - building desktop apps with R backend

Thumbnail reddit.com
9 Upvotes

r/rprogramming • • Aug 27 '26

Early-career marine biologist looking to collaborate on R/data analysis projects

3 Upvotes

Hi everyone!

I’m an early-career marine biologist currently completing my BSc in Marine Biology, and I’m looking to connect with researchers, students, conservationists, and others working with biological or environmental data.

I’ve been developing my skills in R, particularly for data cleaning, statistical analysis, ecological modelling, and data visualization. I genuinely really enjoy working in R, and at this stage I want to get involved with as many different projects and datasets as I reasonably can.

If anyone has a marine science, ecology, conservation, fisheries, wildlife, or other biological dataset that could use some additional help with analysis in R, I’d be happy to contribute. I’m also open to projects outside of marine science if there is an opportunity to work with interesting data and learn something new.

I’m not looking to charge anyone. My main goal is to gain experience working with different types of real-world data, improve my R skills, contribute where I can, and hopefully meet and build connections with people working in science and research.

I also recently created a GitHub where I’ll be archiving my projects as I continue learning. I uploaded a project I finished about a week ago involving the analysis of BRUV data and whitetip reef shark habitat associations.

GitHub: https://github.com/kylealibz

If you have a project where another person helping with the R or data side would be useful, feel free to message me. I’d also be happy just to connect with other early-career researchers and R users.

Thanks!


r/rprogramming • • Aug 07 '26

HELP! duckdb and callr causing Invalid Error: IO Error on Macos

Thumbnail reddit.com
1 Upvotes

r/rprogramming • • Jul 31 '26

shinyglass is on CRAN. Apple-style Liquid Glass aesthetics for Shiny.

Thumbnail reddit.com
1 Upvotes

r/rprogramming • • Jul 29 '26

Is "Mastering Shiny", written in 2021, still valid?

13 Upvotes

I've had more than one programming book that's hopelessly obsolete due to how fast everything moves. Is Mastering Shiny, published by O'Reilly and written by Hadley Wickham, still a useful resource for learning Shiny five years later?


r/rprogramming • • Jul 24 '26

uvr: fast R package and version manager — big 0.4.x update

Thumbnail reddit.com
3 Upvotes

r/rprogramming • • Jul 23 '26

uvr: fast R package and version manager — big 0.4.x update

Thumbnail reddit.com
2 Upvotes