Material from R for Beginners by permission of Emmanuel Paradis