# Language of the Month for September 2020: R

In accordance with our meta agreement to restart the Language of the Month with the top-voted nomination from the old nominations list, we have a new featured language! Throughout September 2020, our Language of the Month, nominated by JayCe, will be:

# R

### What's a Language of the Month?

See the meta post for nominations. In short, during September, those who wish to participate should learn (at least the basics of) R, use it to solve challenges, and discuss it in the R chat room. Participation is completely optional, but is anticipated to be fun!

### Information about R

R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and MacOS.

• It is a general-purpose language, meaning it can be used to answer all questions on this site. Though to be honest, processing strings requires a bit of flexibility.

• Its vectorized syntax allows for concise answers in case of multiple input.

• R is a functional programming language - almost everything is a function - including things that you would think (thanks to the parser) are just operators. This can yield some very powerful golfs, as displayed here.

• Environments, combined with lexical scoping are a power feature of the language.

• It is really good at plotting stuff.

And most importantly: Golfing R is fun :)

### Documentation

(If you consider yourself knowledgeable in R and would like to help teach it to other users, feel free to join the R chat room!)

# cat("Happy golfing!")

• This is very exciting, and (as one of the few [but hopefully about to become many] contributors in R) I'm very happy that R has been chosen. Apart from continuing to post anwsers in R, is there anything else that I could do to help or encourage others? Sep 2 '20 at 15:59
• I have in mind something like choosing a small selection of existing challenges that work well in R (so: not text-based challenges!), so that any/everyone that's interested could focus on the same set... Sep 2 '20 at 16:00
• @DominicvanEssen You can also post an R-themed challenge. In the past I've done a couple of challenges implementing some of R's more interesting built-ins (fivenum, nextn, and match if I recall correctly), and I have a couple more in the Sandbox at the moment (jitter and ave). I'm also toying with having people implement some statistical routines (e.g., given a dataset calculate the empirical CDF / Kaplan-Meier estimator for survival function) but I'm struggling with the I/O a little. Sep 2 '20 at 17:03
• Also can we get a featured on here? Sep 2 '20 at 17:08
• @Giuseppe Makes sense to me, but I think a mod has to do that. Sep 3 '20 at 0:38
• @DominicvanEssen and Giuseppe: Please add your own September R solutions to the list below, too! (When you get the chance.) Sep 3 '20 at 1:04
• – JDL
Sep 3 '20 at 12:59
• There is already a (now frozen) chatroom for golfing in R: chat.stackexchange.com/rooms/81960/golfr ; shouldn't we resuscitate it rather than open a new chatroom? Sep 3 '20 at 13:12
• @RobinRyder Well, shoot. I tried to look for one, but "R" is impossible to search for, so I didn't find it. I could see about getting that unfrozen. There's no content to speak of in the new one yet. Sep 3 '20 at 23:55
• @DLosc Sounds good; if you can get in unfrozen, I am sure a few of us regular R golfers can keep it active. Sep 4 '20 at 17:31
• As a frequent tidyverse user, I'm curious if anyone has a tidyverse answer that beats a base R answer.
– qwr
Sep 5 '20 at 22:06
• @qrt I never use it normally, but I'd also be interested to know if it could be golf-competitive (especially as the %>% paradigm almost makes it into a different language variant to base R). Obviously, the usual need to include tidyverse::, dplyr:: or library(tidyverse) would normally be a disincentive (especially for short challenges), but it would still be interesting to see whether a 'non-competing' R+tidyverse entry that omitted these characters could ever/often beat base R. Are you tempted to try? Sep 6 '20 at 8:11
• library(magrittr) could come in useful if you need to recycle expressions - example from the forward-pipe help: rnorm(100) %>% {c(min(.), mean(.), max(.))} %>% floor. Sep 11 '20 at 9:17

# List of all R solutions posted in September

(First time posters highlighted in bold)

# List of all R tips posted in September

• add entries in the form:

  [<tip title>](https://codegolf.stackexchange.com/a/<answer-ID>) by [username](https://codegolf.stackexchange.com/users/<user-ID>)


# List of R-related challenges posted in September

• add entries in the form:

  [<challenge title>](https://codegolf.stackexchange.com/q/<question-ID>) by [username](https://codegolf.stackexchange.com/users/<user-ID>)

• This should be Community wiki, right? Sep 2 '20 at 6:52
• @Razetime Good idea, I'll do that. Sep 3 '20 at 0:36
• I will be awarding a 50 rep bounty to all first-time R golfers during that period. Please ping me if you add an eligible answer to the list! Oct 5 '20 at 16:36