day 1 slides

day-1-slides Presentation July 2019 DOI: - PDF document

See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/334207202 day-1-slides Presentation July 2019 DOI: 10.13140/RG.2.2.21639.04001 CITATIONS READS 0 33 1 author: Ruan van Mazijk


  1. Kogelberg NR, Observation Pk, Near Pearly Beach, Agulhas Plains, R. van Mazijk R. van Mazijk 2018 R. van Mazijk 2018 2019 An example data-collection scenario in biology

  2. (A good way to collect your data!)

  3. Site 1 Site 2 Site 3 Sp 1 Sp 2 Sp 3 Sp 1 Sp 2 Sp 3 Sp 1 Sp 2 Sp 3

  4. Site 1 Site 2 Site 3 Sp 1 Sp 2 Sp 3 Sp 1 Sp 2 Sp 3 Sp 1 Sp 2 Sp 3 One way to lay out your collected data… 🤣

  5. Site 1 Site 2 Site 3 Sp 1 Sp 2 Sp 3 Sp 1 Sp 2 Sp 3 Sp 1 Sp 2 Sp 3

  6. Site 1 Site 2 Site 3 Sp 1 Sp 2 Sp 3 Sp 1 Sp 2 Sp 3 Sp 1 Sp 2 Sp 3 ???

  7. Site 1 Site 2 Site 3 Sp 1 Sp 2 Sp 3 Sp 1 Sp 2 Sp 3 Sp 1 Sp 2 Sp 3 🤣 ???

  8. Site 1 Site 2 Site 3 Sp 1 Sp 2 Sp 3 Sp 1 Sp 2 Sp 3 Sp 1 Sp 2 Sp 3 🤣 ??? 😥

  9. Site 1 Site 2 Site 3 Sp Another way… 😭

  10. Sp Site 👅😴 😎😙 The “best” way. (Will make your life easiest in the long-term.)

  11. TIDY DATA Sp Site 👅😴 😎😙 The “best” way. (Will make your life easiest in the long-term.)

  12. TIDY DATA CC BY-NC-ND 3.0 Grolemund & Wickham 2017. R for Data Science

  13. TIDY DATA CC BY-NC-ND 3.0 Grolemund & Wickham 2017. R for Data Science

  14. TIDY DATA variable must have its own co 1. Each va column mn 2. Each ob on must have its own ro obse servation row 3. Each va value , therefore, must have its own ce cell CC BY-NC-ND 3.0 Grolemund & Wickham 2017. R for Data Science

  15. tidyr An R-package all about getting to this: CC BY-NC-ND 3.0 Grolemund & Wickham 2017. R for Data Science

  16. # Verbs to tidy your data

  17. # Verbs to tidy your data # Untidy observations? gather() # if > 1 observation per row spread() # if observations live in > 1 row

  18. # Verbs to tidy your data # Untidy observations? gather() # if > 1 observation per row spread() # if observations live in > 1 row # Untidy variables? separate() # if > 1 variable per column unite() # if variables live in > 1 column

  19. Note the following when choosing tidyr -verbs:

  20. Note the following when choosing tidyr -verbs: ons are: • Be clear on what your ob obse servation unit of your study “counts” as an observation • Like, what uni E.g. Leaf traits: plant leaf vs plant individual • E.g. Reproductive success: egg size vs clutch size •

  21. Note the following when choosing tidyr -verbs: ons are: • Be clear on what your ob obse servation unit of your study “counts” as an observation • Like, what uni E.g. Leaf traits: plant leaf vs plant individual • E.g. Reproductive success: egg size vs clutch size • • This will depend on your study &/or data!

  22. Note the following when choosing tidyr -verbs: ons are: • Be clear on what your ob obse servation unit of your study “counts” as an observation • Like, what uni E.g. Leaf traits: plant leaf vs plant individual • E.g. Reproductive success: egg size vs clutch size • • This will depend on your study &/or data! Variables are discrete, separate ideas! • Va

  23. Note the following when choosing tidyr -verbs: ons are: • Be clear on what your ob obse servation unit of your study “counts” as an observation • Like, what uni E.g. Leaf traits: plant leaf vs plant individual • E.g. Reproductive success: egg size vs clutch size • • This will depend on your study &/or data! Variables are discrete, separate ideas! • Va • But again, this will depend on your study &/or data!

  24. # Verbs to tidy your data # Untidy observations? gather() # if > 1 observation per row spread() # if observations live in > 1 row # Untidy variables? separate() # if > 1 variable per column unite() # if variables live in > 1 column

  25. # Untidy observations?

  26. # Untidy observations? gather() # if > 1 observation per row

  27. # Untidy observations? gather() # if > 1 observation per row data %>% gather(key, value, ...)

  28. # Untidy observations? gather() # if > 1 observation per row data %>% gather(key, value, ...) CC BY SA RStudio https://www.rstudio.com/resources/cheatsheets/

  29. # Untidy observations? gather() # if > 1 observation per row data %>% gather(key, value, ...) CC BY SA RStudio https://www.rstudio.com/resources/cheatsheets/

  30. # Untidy observations? gather() # if > 1 observation per row data %>% gather(year, cases, 1999, 2000) CC BY SA RStudio https://www.rstudio.com/resources/cheatsheets/

Recommend


More recommend