Download Workflow of statistical data analysis - 2011
Transcript
c Oliver Kirchkamp Workflow 2.7.1 Plotting functions 2.7.2 Empty plots . . . 2.7.3 Line type . . . . . 2.7.4 Points . . . . . . 2.7.5 Legends . . . . . 2.7.6 Auxiliary lines . 2.7.7 Axes . . . . . . . 2.8 Fancy math . . . . . . . . 2.8.1 Several diagrams 2.9 Tables . . . . . . . . . . . 2.10 Regressions . . . . . . . 2.11 Starting and stopping R 3 4 5 [ 18th July 2013, 10:26 ] — 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 26 27 28 28 29 30 36 37 39 40 41 Organising work 3.1 Scripts . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1 Robust scripts . . . . . . . . . . . . . . . . 3.1.2 Robustness towards different computers 3.1.3 Robustness towards changes in context . 3.1.4 Functions increase robustness . . . . . . . 3.2 Calculations that take a lot of time . . . . . . . . 3.3 Nested functions . . . . . . . . . . . . . . . . . . 3.4 Reproducible randomness . . . . . . . . . . . . . 3.5 Recap — writing scripts and using functions . . 3.6 Human readable scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 42 44 44 45 46 48 48 49 50 51 Some programming techniques 4.1 Debugging functions . . . . 4.2 Lists of variables . . . . . . 4.3 Return values of functions . 4.4 Repeating things . . . . . . . . . . . . . . . . . . 53 53 54 55 56 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data manipulation 59 5.1 Subsetting data . . . . . . . . . . . . . . . . . . . . . . 59 5.2 Merging data . . . . . . . . . . . . . . . . . . . . . . . 59 5.3 Reshaping data . . . . . . . . . . . . . . . . . . . . . . 62