commit ac848bcf5840e44d2dfcfab550b1c268272415e3 parent 9b1248e847ce069a0ac12637c863693070f0b4d9 Author: Jon Harmon <jonthegeek@gmail.com> Date: Fri, 27 May 2022 11:03:42 -0500 Merge pull request #4 from Fgazzelloni/chapter1 Introduction Diffstat:
30 files changed, 215 insertions(+), 98 deletions(-)
diff --git a/01.Rmd b/01.Rmd @@ -1,44 +0,0 @@ -# Introduction - -**Learning objectives:** - -- THESE ARE NICE TO HAVE BUT NOT ABSOLUTELY NECESSARY - -## SLIDE 1 - -- ADD SLIDES AS SECTIONS (`##`). -- TRY TO KEEP THEM RELATIVELY SLIDE-LIKE; THESE ARE NOTES, NOT THE BOOK ITSELF. - -## Meeting Videos - -### Cohort 1 - -(no video recorded) - -### Cohort 2 - -`r knitr::include_url("https://www.youtube.com/embed/PCG52lU_YlA")` - -### Cohort 3 - -`r knitr::include_url("https://www.youtube.com/embed/f6PuOnuZWBc")` - -### Cohort 4 - -`r knitr::include_url("https://www.youtube.com/embed/qDaJvX-Mpls")` - -### Cohort 5 - -`r knitr::include_url("https://www.youtube.com/embed/BvmiQlWOP5o")` - -### Cohort 6 - -`r knitr::include_url("https://www.youtube.com/embed/URL")` - -<details> -<summary> Meeting chat log </summary> - -``` -LOG -``` -</details> diff --git a/01_Introduction.Rmd b/01_Introduction.Rmd @@ -0,0 +1,208 @@ +# Introduction + +**Learning objectives:** + +**For the entire book:** + +- Improve programming skills. +- Develop a deep understanding of the R language fundamentals. +- Understand what functional programming means. + +**For this chapter (includes the Welcome and Preface):** + +- Recognize the differences between the 1st and 2nd edition of this book. +- Describe the overall structure of the book. +- Decide whether this book is right for you. + +Books suggestions: + +- [The Structure and Interpretation of Computer Programs (SICP)](https://mitpress.mit.edu/sites/default/files/sicp/index.html) +- [Concepts, Techniques and Models of Computer Programming](https://mitpress.mit.edu/books/concepts-techniques-and-models-computer-programming) +- [The Pragmatic Programmer](https://pragprog.com/titles/tpp20/the-pragmatic-programmer-20th-anniversary-edition/) + +## What's new? + +> "The [first edition](http://adv-r.had.co.nz) used base R functions almost exclusively, this version of the book expands into more advanced functions provided by other pakages." + +> "Use of new packages, particularly rlang, which provides a clean interface to low-level data structures and operations." + + +```{r, echo=FALSE,out.width="49%",out.height="49%",fig.show='hold',fig.align='center', fig.cap="Twitter: `@hadleywickham` - 6 June 2019"} + +knitr::include_graphics(c("images/01-hadley-image1.jpeg","images/01-hadley-image2.jpeg")) +``` + + + +## Overview of the book structure + + +The book is composed of five sections. A step by step path towards mastering R techniques. +The **Foundations** is the part in which the R components will be examined. It will help understanding how to use all the basics tools to deal with functions and structures. +The **Functional programming** goes a little more in dept into programming with R, making functions of functions. Describing function factories and operators. +The **Object-oriented programming** - OOP is a five chapter section, all about object oriented systems among S3, R6 and S4. +The **Metaprogramming** section introduces you through the programming layers. +Finally, the **Techniques** section is dedicated to finding and fixing bugs and improving performances. + +```{r dia-lib,include=FALSE} +library(DiagrammeR) +``` +<center> +```{r c00, echo=FALSE, fig.align='center', fig.dim="100%"} +DiagrammeR(" + graph TD + A{Foundations}-->B(Functional programming) + B-->C(Object-oriented programming) + C-->D(Metaprogramming) + D-->E(Techniques) + ") +``` +</center> + + +### Foundations + +Six chapters to learn the foundational components of R. +<center> +```{r c01, echo=FALSE, fig.align='center', fig.dim="100%"} +DiagrammeR(" + graph TD + A{Foundations}-->B(Names and values) + A-->C(Control flow) + C-->E(Functions) + B-->D(Vectors) + D-->F(Subsetting) + E-->G(Environment) + G-->H(Conditions) +F-->H + ") +``` +</center> +The last chapter "conditions" describe errors, warnings, and messages. + + +### Functional programming + +This part of the book is dedicated to functions: function factories and operators. + +<center> +```{r c02,echo=FALSE,fig.align='center',fig.dim="100%"} +DiagrammeR(" + graph TD + A{Functional programming}-->B(Functionals) + B-->C(Function factories) + B-->E(Function operators) + ") +``` +</center> + +### Object-oriented programming + + +OOP is the most dense part of the book, as it mentions about systems which interact with R. + +<center> +```{r c03,echo=FALSE,fig.align='center',fig.dim="100%"} +DiagrammeR(" + graph TD + A{Object-oriented programming}-->B(Base types) + B-->C(S3) + B-->E(R6) + B-->D(S4) + D-->F(Trade-offs) + E-->F + C-->F +") +``` +</center> + +### Metaprogramming + +This is the part of the book where things are blended to the **Big Picture**. R is a versatile functional language that can be managed and assembled. + +<center> +```{r c04,echo=FALSE,fig.align='center',fig.dim="100%"} +DiagrammeR(" + graph TD + A{Metaprogramming}-->B(Big Picture) + B-->C(Expressions) + B-->E(Quasiquotation) + B-->D(Evaluation) + + D-->F(Translating R code) +E-->F +C-->F + + ") +``` +</center> + + +### Techniques + +Finally, this is the last section of the book, where debugging is used to measure and improve performance. And how to improve performance by rewriting key functions in C++. + +<center> +```{r c05,echo=FALSE,fig.align='center',fig.dim="100%"} +DiagrammeR(" + graph TD + A{Techniques}-->B(Debugging) + B-->C(Measuring performance) + B-->E(Improving performance) + C-->D(Rewriting R code in C++) +E-->D + + + ") +``` +</center> + +## Resources + +- [first edition](http://adv-r.had.co.nz) +- [advanced-r-solutions](https://advanced-r-solutions.rbind.io/) + + +## Meeting Videos + +### Cohort 1 + +(no video recorded) + +### Cohort 2 + +`r knitr::include_url("https://www.youtube.com/embed/PCG52lU_YlA")` + +### Cohort 3 + +`r knitr::include_url("https://www.youtube.com/embed/f6PuOnuZWBc")` + +### Cohort 4 + +`r knitr::include_url("https://www.youtube.com/embed/qDaJvX-Mpls")` + +### Cohort 5 + +`r knitr::include_url("https://www.youtube.com/embed/BvmiQlWOP5o")` + +### Cohort 6 + +`r knitr::include_url("https://www.youtube.com/embed/dH72riiXrVI")` + +<details> +<summary> Meeting chat log </summary> + +``` +00:14:40 SriRam: From Toronto, Civil Engineer. I use R for infrastructure planning/ GIS. Here coz of the ping 😄 , was not ready with a good computer with mic/audio ! +00:15:20 SriRam: I was with Ryan, Federica on other courses +00:23:21 SriRam: I think the only caution is about Copyright issues +00:31:32 Ryan Metcalf: Citation, giving credit back to source. Great comment SriRam. +00:34:33 SriRam: one = one, in my opinion +00:41:53 Ryan Metcalf: https://docs.google.com/spreadsheets/d/1_WFY82UxAdvP4GUdZ2luh15quwdO1n0Km3Q0tfYuqvc/edit#gid=0 +00:48:35 Arthur Shaw: The README has a nice step-by-step process at the bottom: https://github.com/r4ds/bookclub-advr#how-to-present. I've not done this myself yet, but it looks fairly straightforward. +00:54:13 lucus w: Thanks Ryan. Probably {usethis} will be easier. It looks straight forward +01:00:02 Moria W.: Thank you for sharing that. This has been good! +01:00:08 Vaibhav Janve: Thank you +01:00:44 Federica Gazzelloni: hi SriRam we are going.. +``` +</details> diff --git a/02.Rmd b/02_Names_and_values.Rmd diff --git a/03.Rmd b/03_Vectors.Rmd diff --git a/04.Rmd b/04_Subsetting.Rmd diff --git a/05.Rmd b/05_Control_flow.Rmd diff --git a/06.Rmd b/06_Functions.Rmd diff --git a/07.Rmd b/07_Environments.Rmd diff --git a/08.Rmd b/08_Conditions.Rmd diff --git a/09.Rmd b/09_Functionals.Rmd diff --git a/10.Rmd b/10_Function_factories.Rmd diff --git a/11.Rmd b/11_Function_operators.Rmd diff --git a/12.Rmd b/12_Base_types.Rmd diff --git a/13.Rmd b/13_S3.Rmd diff --git a/14.Rmd b/14_R6.Rmd diff --git a/15.Rmd b/15_S4.Rmd diff --git a/16.Rmd b/16_Trade-offs.Rmd diff --git a/17.Rmd b/17_Big_picture.Rmd diff --git a/18.Rmd b/18_Expressions.Rmd diff --git a/19.Rmd b/19_Quasiquotation.Rmd diff --git a/20.Rmd b/20_Evaluation.Rmd diff --git a/21.Rmd b/21_Translating_R_code.Rmd diff --git a/22.Rmd b/22_Debugging.Rmd diff --git a/23.Rmd b/23_Measuring_performance.Rmd diff --git a/24.Rmd b/24_Improving_performance.Rmd diff --git a/25.Rmd b/25_Rewriting_R_code_in_C++.Rmd diff --git a/DESCRIPTION b/DESCRIPTION @@ -14,4 +14,5 @@ Depends: Imports: bookdown, rmarkdown, - tidyverse + tidyverse, + DiagrammeR diff --git a/README.md b/README.md @@ -3,63 +3,15 @@ Welcome to the R4DS Advanced R Book Club! We are working together to read [_Advanced R_](https://adv-r.hadley.nz/) by Hadley Wickham (Chapman & Hall, copyright 2019, [9780815384571](https://www.routledge.com/Advanced-R-Second-Edition/Wickham/p/book/9780815384571)). -Join the #book_club-advr channel on the [R4DS Slack](https://r4ds.io/join) to participate. +Join the [#book_club-advr](https://rfordatascience.slack.com/archives/C010GJ3VAE5) channel on the [R4DS Slack](https://r4ds.io/join) to participate. As we read, we are producing [notes about the book](https://r4ds.io/advr). ## Meeting Schedule -If you would like to present, please add your name next to a chapter using the [GitHub Web Editor](https://youtu.be/d41oc2OMAuI)! +If you would like to present, please see the sign-up sheet for your cohort (linked below, and pinned in the [#book_club-BOOKABBR](https://rfordatascience.slack.com/archives/BOOKCHANNELID) channel on Slack)! -*Cohort 6: Wednesdays, 13:00 CST/CDT* - -<details> - <summary> Past Meetings </summary> - (none yet) -</details> - -- 2022-05-25: Chapter 1 (Introduction) - Federica Gazzelloni - -**Foundations** - -- 2022-06-01: Chapter 2 (Names and values) - Lucus Wassira -- 2022-06-08: Chapter 3 (Vectors) - Presenter TBD -- 2022-06-15: Chapter 4 (Subsetting) - Presenter TBD -- 2022-06-22: Chapter 5(Control flow) - Presenter TBD -- 2022-06-29: Chapter 6 (Functions) - Presenter TBD -- 2022-07-06: Chapter 7 (Environments) - Presenter TBD -- 2022-07-13: Chapter 8 (Conditions) - Presenter TBD - -**Functional programming** - -- 2022-07-20: Chapter 9 (Functionals) - Presenter TBD -- 2022-07-27: NO MEETING -- 2022-08-03: Chapter 10 (Function factories) - Presenter TBD -- 2022-08-10: Chapter 11 (Function operators) - Presenter TBD - -**Object-oriented programming** - -- 2022-08-17: Chapter 12 (Base types) - Presenter TBD -- 2022-08-24: Chapter 13 (S3) - Presenter TBD -- 2022-08-31: Chapter 14 (R6) - Presenter TBD -- 2022-09-07: Chapter 15 (S4) - Presenter TBD -- 2022-09-14: Chapter 16 (Trade-offs) - Presenter TBD - -**Metaprogramming** - -- 2022-09-21: Chapter 17 (Big picture) - Presenter TBD -- 2022-09-28: Chapter 18 (Expressions) - Presenter TBD -- 2022-10-05: Chapter 19 (Quasiquotation) - Presenter TBD -- 2022-10-12: Chapter 20 (Evaluation) - Presenter TBD -- 2022-10-19: Chapter 21 (Translating R code) - Presenter TBD - -**Techniques** - -- 2022-10-26: Chapter 22 (Debugging) - Presenter TBD -- 2022-11-02: Chapter 23 (Measuring performance) - Presenter TBD -- 2022-11-09: Chapter 24 (Improving performance) - Presenter TBD -- 2022-11-16: Chapter 25 (Rewriting R code in C++) - Presenter TBD - -[Previous cohorts](https://github.com/r4ds/bookclub-Advanced_R). +- Cohorts 1-5: Ended prior to 2022 (and used a [different club format](https://github.com/r4ds/bookclub-Advanced_R)) +- [Cohort 6](https://docs.google.com/spreadsheets/d/1_WFY82UxAdvP4GUdZ2luh15quwdO1n0Km3Q0tfYuqvc/edit?usp=sharing): [Wednesdays, 13:00 CST/CDT](https://www.timeanddate.com/worldclock/converter.html?iso=20220525T180000&p1=24&p2=215) <hr> @@ -69,7 +21,7 @@ If you would like to present, please add your name next to a chapter using the [ This repository is structured as a [{bookdown}](https://CRAN.R-project.org/package=bookdown) site. To present, follow these instructions: -1. [Setup Github Locally](https://www.youtube.com/watch?v=hNUNPkoledI) (also see [_HappyHappy Git and GitHub for the useR_](https://happygitwithr.com/github-acct.html)) +1. [Setup Github Locally](https://www.youtube.com/watch?v=hNUNPkoledI) (also see [_Happy Git and GitHub for the useR_](https://happygitwithr.com/github-acct.html)) 2. Install {usethis} `install.packages("usethis")` 3. `usethis::create_from_github("r4ds/bookclub-advr")` (cleanly creates your own copy of this repository). 4. `usethis::pr_init("my-chapter")` (creates a branch for your work, to avoid confusion). diff --git a/images/01-hadley-image1.jpeg b/images/01-hadley-image1.jpeg Binary files differ. diff --git a/images/01-hadley-image2.jpeg b/images/01-hadley-image2.jpeg Binary files differ.