ASOK15630U  Intro to R for Data Science

Volume 2018/2019

MA Research Methodology and Practice (MSc Curriculum 2015)

Course package (MSc 2015):

Velfærd, ulighed og mobilitet/Welfare, inequality and mobility
Viden, organisation og politik/Knowledge, organisation and politics
Kultur, livsstil og hverdagsliv/Culture, lifestyle and everyday life


R is free to use for everyone and powerful. It has become one of the most widely used programming language for statistical analyses in the social sciences.

This is also true for the new emerging field of “Data Science”, which goes way beyond the social sciences. This course will teach you how to do (social) data science with R: You will learn how to read your data into R, get it into shape, transform and manipulate it, visualise it and how to statistically model it.

Apart from these skills that are necessary for conducting classical statistics, you will also learn some basic programming in R, how to web-scrape Twitter data, and how to do reproducible research and report your results using R Markdown. This course is not an introduction to advances statistics or machine learning.

Learning Outcome


  • R programming language
  • R Studio
  • R Markdown


  • Students will be able to conduct statistical analyses with R.
  • Students will be able to program their own R functions, loops and so on in R.
  • Students will be able to web-scrape Big (Twitter) Data.
  • Students will be able to prepare presentations and reports with R Markdown.


  • Students will increase their analytical and logical cognitive capacities.
  • Students should be able to transform and manipulate data to prepare it for statistical analyses. They will be able to think about data in less narrow way, because R is more flexible than other statistical programming languages.
  • Students should be able to conduct own research based on analyses for which they use R.
  • Students should be able to prepare reproducible research reports and presentations with R Markdown.

The course is largely based on: Grolemund, G. & Wickham, H. (2017): R for Data Science. O’Reilly. This book is freely available at:


Other useful books are:

Matloff, N. (2011): The Art of R Programming. No Starch Press

Teetor, P. (2011): R Cookbook. O’Reilly.

This course is no introduction to statistics! I expect that students are familiar with statistics, although advanced statistics are not necessary. But students should at least have a good understanding of linear regression (OLS) with dummy variable predictors and interaction terms. This is a prerequisite.
Lectures, class assignments, student presentations, a final paper that consists of an empirical analysis reported using R Markdown. Students are expected to contribute actively.
7,5 ECTS
Type of assessment
Written assignment
A written take-home essay is defined as an assignment that addresses one or more questions. The exam is based on the course syllabus, i.e. the literature set by the teacher.

The written take-home essay must be no longer than 10 pages. For group assignments, an extra 5 pages is added per additional student. Further details for this exam form can be found in the Curriculum and in the General Guide to Examinations at KUnet.
Exam registration requirements

Sociology students must be enrolled under MSc Curriculum 2015 to take this exam.

Credit students must be at master level.

Marking scale
7-point grading scale
Censorship form
No external censorship
Exam period

Find more information on your study page at KUnet. Exchange students and Danish full degree guest students please see the homepage of Sociology; and


At re-exam, the form of examination is the same as ordinary exam.
If the form of examination is ”active participation” the re-examination form is always “free written take-home essay”.

Criteria for exam assesment

See learning outcome.

  • Category
  • Hours
  • Class Instruction
  • 28
  • Course Preparation
  • 35
  • Preparation
  • 16
  • Exercises
  • 56
  • Exam Preparation
  • 71
  • Total
  • 206