# Preface

“Introduction to Programming with R is a learning resource for programming novices who want to learn programming using the statistical programming language R. While one of the major strengths of R is the broad variety of packages for statistics and data science, this resource focuses on learning and understanding basic programming concepts using base R. Only a couple of additional packages are used and/or briefly discussed for special tasks.

This online book is specifically written for participants of the course “Introduction to Programming: Programming in R” offered by the Digital Science Center at Universität Innsbruck. If you are interested in further literature you may consider other resources:

### A big thank you

… goes to all who helped writing and improving this book. Whether it was a full chapter, a section, or drawing attention to errors, typos, or incomprehensible wording.

As for now, this learning ressource has to be seen as ‘work in progress’ and there are, for sure, many more typos and transposed letters which will be fixed in the (near) future.

### Practical exercises

Every now and then you will find “practical exercises” within the chapters indicated by an orange question mark. By clicking on the title the exercise will show up (open). The exercises come with solutions (indicated by an orange light bulb). By default, the solution is hidden (closed). Try to solve the exercise on your own before reading the solution!

A hand is an old non-SI unit to measure the size of a horse. An Australien friend just called us and told us he bought a new horse “[…] which is 12.5 hands tall.”. One hand is 101.6 millimeters. How tall is his horse in meters?

Well, that’s a very simple question, but the solution would be something like:

# Calculate the size in meters
x <- 12.5 * 101.6 / 1000 # / 1000 to scale to meters
# Simple print
x
## [1] 1.27
# Or use "cat" to create the output
cat("His horse is ", x, "meters tall") 
## His horse is  1.27 meters tall