Introduction to R. Thomas J. Leeper. November 14, Department of Political Science and Government Aarhus University

Size: px
Start display at page:

Download "Introduction to R. Thomas J. Leeper. November 14, Department of Political Science and Government Aarhus University"

Transcription

1 Introduction to R Thomas J. Leeper Department of Political Science and Government Aarhus University November 14, 2013

2

3 1 Challenges 2

4 1 Challenges 2

5 Frustrations with your current software What frustrations did you have learning your current software? What frustrations do you still have with your current software?

6 Frustrations you will have with R No graphical user interface (GUI)

7 Frustrations you will have with R No graphical user interface (GUI) Lots of add-on packages (lightweight base software)

8 Frustrations you will have with R No graphical user interface (GUI) Lots of add-on packages (lightweight base software) Mistype or misspell commands

9 Frustrations you will have with R No graphical user interface (GUI) Lots of add-on packages (lightweight base software) Mistype or misspell commands Missing data handling

10 Frustrations you will have with R No graphical user interface (GUI) Lots of add-on packages (lightweight base software) Mistype or misspell commands Missing data handling Cryptic error messages

11 1 Challenges 2

12 Why should you use R? Because you want to do more

13 What can you do with R?

14 What can you do with R? Everything

15 What can you do with R? Everything But seriously...

16 What can you do with R? Everything But seriously... Everything

17 What can you do with R? Everything But seriously... Everything: Statistical analysis

18 What can you do with R? Everything But seriously... Everything: Statistical analysis Texting processing

19 What can you do with R? Everything But seriously... Everything: Statistical analysis Texting processing Machine learning

20 What can you do with R? Everything But seriously... Everything: Statistical analysis Texting processing Machine learning Online data

21 What can you do with R? Everything But seriously... Everything: Statistical analysis Texting processing Machine learning Online data High-level visualization

22 What can you do with R? Everything But seriously... Everything: Statistical analysis Texting processing Machine learning Online data High-level visualization Sudoku

23 Why should you use R? Because you want to do more

24 Why should you use R? Because you want to do more Because you can create a better scientific workflow

25 Why is R better for science? R will always be here Scripting Reproducible research tools Scripting Report generation Data sharing

26 Reproducible Research All data and replication code is public All results come directly from code Analysis is about writing a script, not pointing and clicking Makes changes and collaboration easier

27 Scientific Workflow Store data in perpetually readable formats Write a complete analysis script Script should run analysis and output results Reports should import results directly Share data, script, and codebooks

28 Questions so far?

29 Why should you use R? Because you want to do more Because you can create a better scientific workflow

30 Why should you use R? Because you want to do more Because you can create a better scientific workflow Because everyone else is doing it

31 What is everyone else doing?

32 What is everyone else doing?

33 What is everyone else doing?

34 What is everyone else doing?

35 What is everyone else doing?

36 What is everyone else doing?

37 What is everyone else doing?

38 Impact of popularity Huge community support Cutting edge techniques Versatile

39 Why should you use R? Because you want to do more Because you can create a better scientific workflow Because everyone else is doing it

40 Why should you use R? Because you want to do more Because you can create a better scientific workflow Because everyone else is doing it Because it is free

41 What is freedom? Freedom means free

42 What is freedom? Freedom means free Freedom means forever

43 What is freedom? Freedom means free Freedom means forever Freedom means independence

44 What is freedom? Freedom means free Freedom means forever Freedom means independence Freedom means control

45 Why should you use R? Because you want to do more Because you can create a better scientific workflow Because everyone else is doing it Because it is free

46 Why should you use R? Because you want to do more Because you can create a better scientific workflow Because everyone else is doing it Because it is free Because R is beautiful

47 Graphs are beautiful You can make data look like art

48

49

50

51

52

53 Questions so far?

54