# Sources for learning (not just running) statistics/math through R

I am interested in examples of sources (R code, R packages, books, book chapters, articles, links etc) for learning statistical and mathematical concepts through R (it could also be through other languages, but R is my favorite flavor).

The challenge is that the learning of the material relies on the programming, not just on how to run a code that performs the algorithm.

So (for example) a book like Linear models with R (which is a great book) is not what I am looking for. This is since this books mainly shows how to implement linear models in R, but it does not revolve around teaching linear models by using R.

The help files for the (wonderful) TeachingDemos package is a good example of what I am looking for. It is an R package which includes functions for learning statistical concepts through various R applets and simulations. The accompany help files are nice. Of course, neither are sufficient, and require an external text-book in order to master many of the exact details to learn them (well, the help files do).

All leads will be much appreciated.

• This book might be relevant: amazon.com/… Dec 25 '16 at 18:06

I think R (or perhaps a comparable programming language) can be extremely helpful in learning about statistics. Of course, this will require that students learn some programming as well, which may be a bridge too far, so depending on your audience, you may need to do all the programming yourself and just show students the simulations. An example of this can be found in my answer here, regarding teaching the idea of the sampling distribution (warning the code is ugly and comically inefficient).

On the other hand, if you want to try having your students learn some programming along the way as well, there are some introductory statistics books based to varying degrees on that model:

There is "Introduction to Probability and Statistics Using R" by G. Jay Kerns available at http://ipsur.org/ and as the R package IPSUR. From the title alone, it seems like the type of text you are looking for.

• +1 Incidentally, Jay Kerns is a highly regarded member of our site :-).
– whuber
Oct 29 '12 at 17:10
• @whuber: that link do not work! Dec 25 '16 at 22:23
• @Kjetil I'm sorry to say his account was removed from this site six months ago.
– whuber
Dec 25 '16 at 23:33

I think the benchmark in the field here is "An Introduction to Statistical Learning - with applications in R" http://www-bcf.usc.edu/~gareth/ISL/

I recommend the R package swirl, which sounds exactly like what you're looking for- learning R and statistics, not only using R, but in R itself.

I really like the book "introductory statistics with R" a very practical book. It walks you through the basic statistics and implementations in R.