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 • • Apr 17 '21

The sacred texts!

Post image
133 Upvotes

r/rprogramming • • Jan 12 '21

I am creating a 'Khan Academy' for R Programmers

118 Upvotes

NDEXR.COM

I'm starting a not for profit site to create high quality R programming courses. I am starting with an R in Production course, where I will be teaching everything I wish I knew 7 years ago when I first started.

If you like, you can also sign up and create courses as well.

Feel free to check it out - the #rip course is a work in process.


r/rprogramming • • Sep 03 '24

Made a donut in the terminal using R

88 Upvotes

r/rprogramming • • Dec 10 '20

Data Science Learning Resources

88 Upvotes

It was requested in the past to but together some resources for new R users. Below is a collection of everything I could find to help others out.

Data Science Learning Resources

Sections

  • Programming

  • Machine Learning

  • Leadership & Strategy

Programming

General

Python

R

Spark

Command Line

Containers

Functional Programming

Version Control

Code Packaging

Style Guide, Readability, Best Practices

Testing

Machine Learning

General

Unsupervised Modeling

A/B Testing

Multivariate Adaptive Regression Splines

K-Nearest Neighbor

Random Forests

Gradient Boosting Machines

Deep Learning

Ensembles / Model Stacking / Super Learners

Natural Language Processing / Text Mining

Tuning

Feature Engineering

Feature Selection

Machine Learning Interpretability

Auto ML

Benchmarking

Resampling Procedures

Productionalization

Leadership & Strategy


r/rprogramming • • Jul 02 '21

Can we please ban users who abuse this sub to enhance their search engine ranking?

84 Upvotes

There is a certain user who will, for now, remain unnamed who regularly posts links to their low quality R tutorials in order to acquire many inbound links, this boosting their ranking in Google search results for anything R related.

If the content were high quality I would not take that much umbrage with the behaviour, but they seem less adept at using R than most off my undergraduate students after their first R course.

I feel this person is actively harming the R community by attempting to forcefully impose themselves as a prominent R user, particularly give the exceptionally low quality of their "tutorials."

We should not continue to allow this person or any others who may follow in the future, to take advantage of this subreddit for their personal gain.


r/rprogramming • • Feb 11 '25

What R packages you can't live without

81 Upvotes

Obviously, a person working in finance would have different needs than someone in biostatistics. But it'd be cool to know what packages you use with a brief description of what you use it for.


r/rprogramming • • Jul 16 '21

Me after discovering fread today:

Post image
80 Upvotes

r/rprogramming • • Nov 22 '20

SQL Joins in R with merge function

Post image
76 Upvotes

r/rprogramming • • Nov 12 '18

20 Best Libraries for Data Science in R Programming

Post image
75 Upvotes

r/rprogramming • • Feb 29 '20

Happy 20th birthday to R 1.0.0! CelebRation2020 Copenhagen

Post image
73 Upvotes

r/rprogramming • • Aug 25 '21

We are joining the protest against Reddit inaction on covid misinformation subreddits

Thumbnail reddit.com
72 Upvotes

r/rprogramming • • Dec 10 '21

I am concerned about the tidyverse and it’s impact on the R community and language.

68 Upvotes

Hello, I am a long time R user, about 15 years. I am a base R user, although I admit, I do use ggplot2 and shiny. I teach doctoral R programming courses and hold frequent workshops.

A trend I have noticed is that more and more of my students entering my course are unable to follow my syntax. They increasingly ask me where are the pipes?!

I must admit I really dislike the pipe. It’s only purpose is to change the reading and writing style of the human interaction with syntax. This is leading to a sharp fracture in the community.

I have students who cant follow programming from the inside out, they want to read left to right like it’s some form of English.

I guess… I respect Hadly and the tidy mission to make the language more accessible. That said, I think it’s having the opposite effect. A fractured community with sub languages so different that both sides can’t understand one another.

I love R, I always start my semester by jokingly telling students R is more of a lifestyle than a language.

I just wanted to hear some thoughts. When I repeat this to colleagues I get mixed responses, almost always culminating in “but really who cares”…. I care!


r/rprogramming • • Jan 21 '21

R color palette inspired by the amazing women at today's inauguration!

Post image
68 Upvotes

r/rprogramming • • Aug 02 '24

Making a living with R

67 Upvotes

I have been working as a Data Scientist for about 9 years and have an M.S. in stats. Currently a Lead Data Scientist. I am good at programming in both R and python, but strongly prefer R over python.

Broadly, has anyone made a living with R in Data Science? If so, how? What industry are you in? Is your official title Data Scientist?

R seems to be making ground on SAS in clinical trials. Besides working in this industry, I don't see a path forward to making a living with R.

Edit: I have had only one job that used R and we transitioned to python going forward. I ended up learning python out of necessity, not desire.


r/rprogramming • • Jul 30 '22

I was really hoping this sub would be called r/r

67 Upvotes

r/rprogramming • • Aug 17 '24

Could I be the youngest person to ever create an R Package uploaded to CRAN?

65 Upvotes

Good day, I spent my summer break learning R and making my own package, and I successfully created one. Of course the next reasonable thing to do was to upload it to CRAN, so I did. And today, after several submissions, I finally got an email stating that they will manually check it.

So, I'm in 8th Grade and I was wondering if there was a possibility of me becoming the youngest one to do this. Thanks!


r/rprogramming • • Dec 01 '20

700 Free R Programming Tutorials

59 Upvotes

I've just published the 700th (!) tutorial on my R programming and statistics learning platform https://statisticsglobe.com/. Please check it out in case you want to learn R for free. :)


r/rprogramming • • Jun 17 '21

"[O]ne of the joys of using R [...] is the active and vibrant user community"

Thumbnail
gallery
56 Upvotes

r/rprogramming • • Sep 25 '22

I found R too difficult, but with tidyverse, I have changed my mind

53 Upvotes

I had to use R at my new job and was frustrated, as I didn't find it intuitive at all (I liked pandas way more). However, that was before I started using the tidyverse library.

If there are other struggling R newbies out there, here is an article about what tidyverse is all about and how it is linked to SQL tidyverse intro 🙂


r/rprogramming • • Jun 29 '22

I made this

50 Upvotes

r/rprogramming • • Apr 12 '26

R Packages for Data Science

Post image
48 Upvotes

r/rprogramming • • Jul 31 '20

100 R tutorials in 15 Days - Programming Challenge Finished!

47 Upvotes

I've just finished a programming challenge where I created 100 R tutorials on my homepage https://statisticsglobe.com/. It took me exactly 15 days, 80 hours, 23 minutes, and 06 seconds to finish, so I hope you like the results! :D Please find a list of all tutorials below:

https://statisticsglobe.com/correlation-matrix-in-r

https://statisticsglobe.com/display-large-numbers-separated-with-comma-in-r

https://statisticsglobe.com/zoom-into-ggplot2-plot-without-removing-data-in-r

https://statisticsglobe.com/read-files-directory-apply-function-to-each-data-frame-in-r

https://statisticsglobe.com/subset-of-data-frame-rows-containing-na-in-r

https://statisticsglobe.com/remove-all-special-characters-from-string-in-r

https://statisticsglobe.com/remove-first-row-of-data-frame-in-r

https://statisticsglobe.com/convert-character-string-to-date-object-in-r

https://statisticsglobe.com/fit-smooth-curve-to-plot-of-data-in-r

https://statisticsglobe.com/convert-unix-timestamp-to-date-object-in-r

https://statisticsglobe.com/select-rows-with-partial-string-match-in-r

https://statisticsglobe.com/unique-combinations-of-all-elements-from-two-vectors-in-r

https://statisticsglobe.com/export-nicely-formatted-data-frame-in-r

https://statisticsglobe.com/disable-messages-when-loading-a-package-in-r

https://statisticsglobe.com/randomly-reorder-data-frame-by-row-and-column-in-r

https://statisticsglobe.com/ggplot2-title-subtitle-with-different-size-and-color-in-r

https://statisticsglobe.com/suppress-output-of-command-in-r

https://statisticsglobe.com/paste-multiple-columns-together-in-r

https://statisticsglobe.com/compute-eulers-number-in-r

https://statisticsglobe.com/change-spacing-of-axis-tick-marks-in-base-r-plot

https://statisticsglobe.com/round-up-to-nearest-10-or-100-in-r

https://statisticsglobe.com/find-position-of-character-in-string-in-r

https://statisticsglobe.com/print-time-with-milliseconds-in-r

https://statisticsglobe.com/find-values-contained-in-first-vector-but-not-another-in-r

https://statisticsglobe.com/overlay-density-plots-in-base-r

https://statisticsglobe.com/repeat-rows-of-data-frame-n-times-in-r

https://statisticsglobe.com/quit-restart-clean-r-session-from-within-r

https://statisticsglobe.com/skip-loop-to-next-iteration-in-r

https://statisticsglobe.com/left-align-text-in-ggplot2-plot-in-r

https://statisticsglobe.com/convert-vector-to-list-in-r

https://statisticsglobe.com/report-missing-values-in-data-frame-in-r

https://statisticsglobe.com/set-ggplot2-axis-limit-only-on-one-side-in-r

https://statisticsglobe.com/return-column-name-of-largest-value-for-each-row-in-r

https://statisticsglobe.com/remove-multiple-data-objects-using-rm-function-in-r

https://statisticsglobe.com/convert-characters-in-data-frame-to-uppercase-in-r

https://statisticsglobe.com/add-count-labels-on-top-of-ggplot2-barchart-in-r

https://statisticsglobe.com/extract-numbers-from-character-string-vector-in-r

https://statisticsglobe.com/apply-function-to-data-table-in-each-specified-column-in-r

https://statisticsglobe.com/specify-column-names-for-x-y-when-joining-with-dplyr-package-in-r

https://statisticsglobe.com/convert-data-frame-to-data-table-in-r

https://statisticsglobe.com/remove-multiple-columns-from-data-table-in-r

https://statisticsglobe.com/get-column-index-in-data-frame-by-variable-name-in-r

https://statisticsglobe.com/fix-aspect-ratio-in-ggplot2-plot-in-r

https://statisticsglobe.com/plot-all-columns-of-data-frame-in-r

https://statisticsglobe.com/reset-par-to-default-values-in-r

https://statisticsglobe.com/control-size-of-ggplot2-legend-items-in-r

https://statisticsglobe.com/r-save-all-console-input-output-to-file

https://statisticsglobe.com/r-split-data-frame-into-list-of-data-frames-based-on-id-column

https://statisticsglobe.com/extract-data-table-column-as-vector-using-index-position-in-r

https://statisticsglobe.com/set-area-margins-of-ggplot2-plot-in-r

https://statisticsglobe.com/change-y-axis-to-percentages-in-ggplot2-barplot-in-r

https://statisticsglobe.com/count-number-of-words-in-character-string-in-r

https://statisticsglobe.com/insert-new-column-between-two-data-frame-variables-in-r

https://statisticsglobe.com/sort-variables-of-data-frame-by-column-names-in-r

https://statisticsglobe.com/remove-empty-rows-of-data-frame-in-r

https://statisticsglobe.com/create-comma-separated-vector-in-r

https://statisticsglobe.com/randomize-vector-in-r

https://statisticsglobe.com/split-data-frame-in-r

https://statisticsglobe.com/indexing-up-to-the-end-of-vector-data-frame-in-r

https://statisticsglobe.com/replace-multiple-letters-with-accents-in-r

https://statisticsglobe.com/select-first-row-of-each-group-in-data-frame-in-r

https://statisticsglobe.com/select-first-element-of-nested-list-in-r

https://statisticsglobe.com/arrange-list-of-ggplot2-plots-in-r

https://statisticsglobe.com/multiply-rows-of-matrix-by-vector-in-r

https://statisticsglobe.com/replace-values-in-data-frame-conditionally-in-r

https://statisticsglobe.com/create-data-frame-where-a-column-is-a-list-in-r

https://statisticsglobe.com/sum-across-multiple-rows-columns-using-dplyr-package-in-r

https://statisticsglobe.com/extract-just-number-from-named-numeric-vector-in-r

https://statisticsglobe.com/ggplot2-plot-in-script-is-not-displayed-in-r

https://statisticsglobe.com/change-display-order-of-ggplot2-plot-legend-in-r

https://statisticsglobe.com/save-plot-in-data-object-in-base-r

https://statisticsglobe.com/unique-rows-of-data-frame-based-on-selected-columns-in-r

https://statisticsglobe.com/draw-multiple-lattice-plots-in-one-window-in-r

https://statisticsglobe.com/convert-named-vector-to-data-frame-in-r

https://statisticsglobe.com/use-apply-function-only-for-specific-data-frame-columns-in-r

https://statisticsglobe.com/check-existence-of-local-file-in-r

https://statisticsglobe.com/remove-gridlines-in-ggplot2-plot-in-r

https://statisticsglobe.com/coerce-list-object-to-type-double-in-r

https://statisticsglobe.com/create-sequence-of-repeated-values-in-r

https://statisticsglobe.com/select-multiple-elements-from-list-in-r

https://statisticsglobe.com/undefined-columns-selected-when-subsetting-data-frame-in-r

https://statisticsglobe.com/dplyr-mutate-function-with-logical-condition-in-r

https://statisticsglobe.com/change-colors-in-ggplot2-line-plot-in-r

https://statisticsglobe.com/keep-unused-factor-levels-in-ggplot2-barplot-in-r

https://statisticsglobe.com/number-of-months-between-two-dates-in-r

https://statisticsglobe.com/drop-multiple-columns-from-data-frame-using-dplyr-package-in-r

https://statisticsglobe.com/combine-two-ggplot2-plots-from-different-data-frames-in-r

https://statisticsglobe.com/determine-path-of-current-script-in-r

https://statisticsglobe.com/extract-regression-coefficients-of-linear-model-in-r

https://statisticsglobe.com/draw-time-series-plot-with-events-using-ggplot2-in-r

https://statisticsglobe.com/count-number-of-rows-by-group-using-dplyr-package-in-r

https://statisticsglobe.com/reorder-facets-in-ggplot2-plot-in-r

https://statisticsglobe.com/combine-multiple-ggplot2-legends-in-r

https://statisticsglobe.com/display-only-integer-values-on-ggplot2-axis-in-r

https://statisticsglobe.com/get-second-sub-element-of-every-list-element-in-r

https://statisticsglobe.com/merge-unequal-data-frames-replace-na-with-0-in-r

https://statisticsglobe.com/annotate-text-outside-of-ggplot2-plot-in-r

https://statisticsglobe.com/control-point-border-thickness-of-ggplot2-plot-in-r

https://statisticsglobe.com/two-functions-with-same-name-in-different-packages-in-r

https://statisticsglobe.com/convert-data-frame-with-date-column-to-time-series-object-in-r