Slide 1

Slide 1 text

Alison Hill, Associate Professor of Pediatrics & Assistant Director of OHSU’s Center for Spoken Language Understanding @apreshill @apreshill https://alison.rbind.io/ Slides: http://bit.ly/cascadiarconf-magic BIG MAGIC WITH R: CREATIVE LEARNING BEYOND FEAR

Slide 2

Slide 2 text

2 This work is licensed under a Creative Commons Attribution-ShareAlike4.0 International License. To view a copy of this license, visit: https://creativecommons.org/licenses/by-sa/4.0/

Slide 3

Slide 3 text

3 My inspiration today! Image credits: https://www.elizabethgilbert.com/

Slide 4

Slide 4 text

4 Who am I? • Use R every day • Self-taught

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

pre-tidyverse

Slide 8

Slide 8 text

8 Who am I? • Use R every day • Self-taught • Taught > 100 MS + PhD students

Slide 9

Slide 9 text

9 Who are you? • R curious? R beginner? Advanced user? • Use R every day? Every week?

Slide 10

Slide 10 text

Do your job better Get a ^ job Why are we all here? better

Slide 11

Slide 11 text

Courage Enchantment Permission Persistence Trust

Slide 12

Slide 12 text

COURAGE

Slide 13

Slide 13 text

COURAGE IS A PLAN

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

TIDY COURAGE

Slide 19

Slide 19 text

TIDY COURAGE

Slide 20

Slide 20 text

Introduction to the Tidyverse By David Robinson https://www.datacamp.com/courses/introduction-to-the-tidyverse “Learn R, in R” http://swirlstats.com/students.html INTERACTIVE COURAGE

Slide 21

Slide 21 text

BASE R COURAGE https://nostarch.com

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

23 All-purpose courage • Package reference docs (usage / arguments / examples) • Package vignette • GitHub README • Is there an RStudio Cheatsheet? (https://www.rstudio.com/resources/cheatsheets/) • Are there Stat545 materials by Jenny Bryan? (http://stat545.com) • Is there a roundup by Mara Averick? (https://maraaverick.rbind.io/tags/roundups/) • RWeekly “R Tutorials”: https://rweekly.org/#Tutorials

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

IDEAS WORDS R

Slide 26

Slide 26 text

IDEAS WORDS R

Slide 27

Slide 27 text

27 NO COURAGE, NO PLAN

Slide 28

Slide 28 text

28 COURAGEOUS PLANNER

Slide 29

Slide 29 text

ENCHANTMENT

Slide 30

Slide 30 text

ENCHANTMENT IS THE JOY OF WORKING WITH CODE THAT JUST WORKS

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

“It’s not magic; it’s code.” — Ben Welsh, L.A. Times Data Editor

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

DO NOT JUST READ CODE* *Dunlosky, J., Rawson, K. A., Marsh, E. J., Nathan, M. J., & Willingham, D. T. (2013). Improving students’ learning with effective learning techniques: Promising directions from cognitive and educational psychology. Psychological Science in the Public Interest, 14(1), 4-58.

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Use #comments and ? ?function_name Description Usage Arguments

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

REPETITION IS POWERFUL

Slide 42

Slide 42 text

IDEAS WORDS R

Slide 43

Slide 43 text

IDEAS WORDS R

Slide 44

Slide 44 text

44 ADDING ENCHANTMENT

Slide 45

Slide 45 text

45 JUST ENOUGH ENCHANTMENT

Slide 46

Slide 46 text

PERMISSION

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

“Your [work] not only doesn’t have to be original…it also doesn’t have to be important.” —Elizabeth Gilbert, Big Magic

Slide 49

Slide 49 text

49 Find projects to copy • RWeekly “R in the Real World”: https://rweekly.org/#RintheRealWorld • Julia Silge (Data Scientist, Stack Overflow) https://juliasilge.com • Dave Robinson (Data Scientist, DataCamp) http://varianceexplained.org • Maëlle Salmon (ROpenSci, LockeData) http://www.masalmon.eu • Lucy and Nick (Vandy biostats students) http://livefreeordichotomize.com

Slide 50

Slide 50 text

50

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

CHOOSE WISELY

Slide 53

Slide 53 text

NOT YOUR STYLE

Slide 54

Slide 54 text

NOT YOUR PROBLEM

Slide 55

Slide 55 text

NOT YOUR LEVEL (YET!)

Slide 56

Slide 56 text

IDEAS WORDS R

Slide 57

Slide 57 text

IDEAS WORDS R Your

Slide 58

Slide 58 text

58 PERMISSION TO TRY FOR THIS

Slide 59

Slide 59 text

59 PERMISSION TO FEEL LIKE THIS

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

PERSISTENCE

Slide 63

Slide 63 text

“For most of history people just made things, and they didn’t make such a big freaking deal about it.” —Elizabeth Gilbert, Big Magic

Slide 64

Slide 64 text

Hilary Parker https://hilaryparker.com/2013/01/30/hilary-the-most-poisoned-baby-name-in-us-history/

Slide 65

Slide 65 text

Julia Silge https://juliasilge.com/blog/my-baby-boomer-name/

Slide 66

Slide 66 text

Monica Gerber http://www.monicagerber.com/2018/03/little-bit-of-monica/

Slide 67

Slide 67 text

Brooke Watson https://blog.brooke.science/posts/the-us-of-bey/

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

Problem: The data are in Wikipedia tables I need to scrape!

Slide 71

Slide 71 text

Problem: The data are in Wikipedia tables I need to scrape! Solution: Learn rvest

Slide 72

Slide 72 text

New Problem: I need to scrape the same table for all 8 series!

Slide 73

Slide 73 text

New Problem: I need to scrape the same table for all 8 series! Solution: Add purrr

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

76 My purrrlist • Jennifer Thompson’s R-Ladies Intro: https://github.com/jenniferthompson/RLadiesIntroT oPurrr • Jenny Bryan’s tutorial: https://jennybc.github.io/purrr-tutorial/ • Charlotte Wickham’s tutorial: https://github.com/cwickham/purrr-tutorial • RStudiopurrr cheatsheat: https://github.com/rstudio/cheatsheets/blob/maste r/purrr.pdf • Colin Fay’s purrr blog series: http://colinfay.me/tags/purrr/ • Mara Averick’s roundup of “purrr-ty posts”: https://maraaverick.rbind.io/2017/09/purrr-ty-posts/

Slide 77

Slide 77 text

IDEAS WORDS R

Slide 78

Slide 78 text

IDEAS WORDS R Your

Slide 79

Slide 79 text

You aren’t doing it wrong if no one knows what you are doing

Slide 80

Slide 80 text

TRUST

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

No content

Slide 83

Slide 83 text

83 Trust • GitHub: https://github.com – Open an account – You will need this: http://happygitwithr.com • Your own website – My recommendation (obvious, biased): use blogdown – You will need this: https://bookdown.org/yihui/blogdown/ • A friend! – Make sure someone else at your code! – Ideas: • Partner up with someone in your team / lab / company • Find a coding partner at your local R Meet-up or R-Ladies group • Ask the #rstats twitterverse!

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

https://edwinth.github.io/blog-new-things/

Slide 86

Slide 86 text

86 Up & running with blogdown https://alison.rbind.io/post/up-and-running-with-blogdown/

Slide 87

Slide 87 text

https://amber.rbind.io/blog/2016/12/19/creatingsite/

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

Where are we?

Slide 90

Slide 90 text

X I don’t know X, but I know I can figure it out…

Slide 91

Slide 91 text

X Courage Enchantment Permission Persistence TRUST!

Slide 92

Slide 92 text

X Courage Enchantment Permission Persistence TRUST!

Slide 93

Slide 93 text

93 Learning should not feel like this

Slide 94

Slide 94 text

94 Learning should feel like this

Slide 95

Slide 95 text

Trey Speegle- https://20x200.com/products/trey-speegle-thank-you