Structure of an R course for beginners

Viewed 1801

I realize that this is a question that will probably not have a single best answer, and that it might be closed as such, but I think that this might get some very useful answers so maybe it can be turned into CW instead.

Suppose you have to give a course on R to complete beginners, and that you have limited time to do so so you need to make choices in what you emphasize. This is great, young innocent minds to bend to our will! But how do we do that?

How can we best setup an R course for absolute beginners so that they become efficient users of R. We want them to do everything right and efficient, but of course we want them to be able to do things in the first place even more. Some issues that come to my mind here are:

  • Indenting and using proper coding styles is very important. Should this be the first thing to come up? Even before looking at how to assign objects?
  • Loops vs applies vs vectorizations, what do you emphasize first? I think loops are so easy to learn and straightforward that those are nice to emphasize first, they might not produce very efficient code but they will be able to get things working! Then again, immediatly stressing vectorizations might get them to be more efficient in the long run.
  • Let them use RStudio from the beginning?
  • What would be a good order to introduce things?
6 Answers

I just gave a tutorial on R to graduate students in economics, assuming no prior knowledge of programming.

My contents:

  • discussion on tools for data analysis
  • text-editors
  • getting R
  • R language fundamentals: vectors and matrices
  • application: formulate your own OLS estimator
  • lm function and formulas showcase
  • t-test and f-test
  • maximum likelihood: probit
  • installing packages and CRAN views
  • getting help
  • suggested readings

I believed quite important to cover some language fundamentals, but I did not reach half of the topics that quite a few people left the presentation, likely thinking "this is too much... I won't use this". On a future opportunity, I would move language fundamentals to an "intermediate" session, and format the intro. tutorial more as a showcase to sell this technology, and then be clear on what they should read next if they are "in". There goes a tradeoff between rigorously correct and interesting (unless programming language details are of interest to your public).

Once you start talking about language details, it's hard to figure when you should stop. Once you gave vectors and matrices, you should mention some subscripts, some data.frame, which brings you to talk about lists, and how to convert between matrix and data.frame... That easily covers 2 hours. And it's not a sexy sales pitch for an absolute beginner!

I did not and would not use Rstudio in a presentation. If the "traditional" terminal/text-editor is too abstract for them, then so is R too abstract for them. A fancy windowed environment won't change much to it. But do mention that there are such interfaces. Also mention that R is cross-platform, and discuss differences/similarities between platforms, even if >90% of your audience uses Windows.

Related