bookclub-advr

DSLC Advanced R Book Club
git clone https://git.eamoncaddigan.net/bookclub-advr.git
Log | Files | Refs | README | LICENSE

commit 9ef7fc70e0fcab37ee6535e72d39dea3d07b8898
parent b8bb282e2fca7352f35c8c046f90b269dcad6b3b
Author: fgazzelloni <docksbox@pm.me>
Date:   Wed, 25 May 2022 16:50:18 +0200

Introduction

Diffstat:
D01.Rmd | 44--------------------------------------------
A01_Introduction.Rmd | 190+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
R02.Rmd -> 02_Names_and_values.Rmd | 0
R03.Rmd -> 03_Vectors.Rmd | 0
R04.Rmd -> 04_Subsetting.Rmd | 0
R05.Rmd -> 05_Control_flow.Rmd | 0
R06.Rmd -> 06_Functions.Rmd | 0
R07.Rmd -> 07_Environments.Rmd | 0
R08.Rmd -> 08_Conditions.Rmd | 0
R09.Rmd -> 09_Functionals.Rmd | 0
R10.Rmd -> 10_Function_factories.Rmd | 0
R11.Rmd -> 11_Function_operators.Rmd | 0
R12.Rmd -> 12_Base_types.Rmd | 0
R13.Rmd -> 13_S3.Rmd | 0
R14.Rmd -> 14_R6.Rmd | 0
R15.Rmd -> 15_S4.Rmd | 0
R16.Rmd -> 16_Trade-offs.Rmd | 0
R17.Rmd -> 17_Big_picture.Rmd | 0
R18.Rmd -> 18_Expressions.Rmd | 0
R19.Rmd -> 19_Quasiquotation.Rmd | 0
R20.Rmd -> 20_Evaluation.Rmd | 0
R21.Rmd -> 21_Translating_R_code.Rmd | 0
R22.Rmd -> 22_Debugging.Rmd | 0
R23.Rmd -> 23_Measuring_performance.Rmd | 0
R24.Rmd -> 24_Improving_performance.Rmd | 0
R25.Rmd -> 25_Rewriting_R_code_in_C++.Rmd | 0
MDESCRIPTION | 3++-
Aimages/01-hadley-image1.jpeg | 0
Aimages/01-hadley-image2.jpeg | 0
29 files changed, 192 insertions(+), 45 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,190 @@ +# Introduction + +**Learning objectives:** + +- Improve programming skills +- Deep understanding of the language fundamentals +- Understand what functional programming means + +Books suggestions: + +- The Structure and Interpretation of Computer Programs45 (SICP) +- Concepts, Techniques and Models of Computer Programming +- The Pragmatic Programmer + +## 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/URL")` + +<details> +<summary> Meeting chat log </summary> + +``` +LOG +``` +</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/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.