class: center, middle, inverse, title-slide # R Markdown - A Better Way of Communicating with Data ### Danyang Dai ### The University of Melbourne ### August 24, 2020
https://rmarkdown-rladiesmelbourne.netlify.app
--- <style type="text/css"> h2, h3 { margin-bottom: 0px; } .highlight-output{ color: #88398A; } .footnote{ bottom: 2em; } </style> # About Me - Graduated from Monash University with Bachelors of Commerce in 2018 - Currently a Masters Student at the University of Melbourne <img src="index_files/figure-html/edu_plot-1.png" style="display: block; margin: auto;" /> --- class: center, middle # Find Me at [<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z"></path></svg> danyangd@student.unimelb.edu.au](mailto:danyangd@student.unimelb.edu.au) [<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"></path></svg> https://dai.netlify.app](https://dai.netlify.app) [<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg> @Daidaidai2014](https://twitter.com/Daidaidai2014) [<svg viewBox="0 0 496 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg> @DanyangDai ](https://github.com/DanyangDai) [<svg viewBox="0 0 448 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"></path></svg> https://www.linkedin.com/in/danyang-dai-7529b4152/](https://www.linkedin.com/in/danyang-dai-7529b4152/) --- # Why R Markdown -- .center[<img src="https://media.giphy.com/media/HufOeXwDOInlK/giphy.gif" style="width:40%"/>] -- ### Hypothesis testing -- ### Bayesian Estimation and Graphical presentation -- ### Demonstration of Reproducible report --- # Case Study - Hypothesis Testing .left-column[Example - yearly wage of 474 bank employees] .right-column[ - y: natural logarithm of salary (LOGSAL) - `\(x_{1}\)`: individual's number of completed years of schooling (EDUC) - `\(x_{2}\)`: information on the employee's gender (GENDER: 0 for females, 1 for males) - `\(x_{3}\)`: whether or not they belong to a minority group (MINORITY : 0 for non-minority, 1 for minorities) - `\(x_{4}\)`: a categorical variable indicating the nature of the position in which the individual is employed (JOBCAT: 1 for administrative jobs, 2 for custodial jobs, and 3 for management jobs) - We are interested in testing hypotheses in the model - `\(y = \beta_{0}+\beta_{educ}x_{1}+\beta_{gender}x_{2}+\beta_{minority}x_{3}+\beta_{jobcat}x_{4}+u_{i}\)` ] .footnote[Data provided by Professor Chris Skeels in Econometrics 3 ECOM90013] --- ## Hypothesis Testing ### Does Education affect annual salary? .left-column[ `\(H_{0}: \beta_{educ} = 0\)` `\(H_{1}: \beta_{educ} \neq 0\)` ] .right-column[ ```r ## LM Test lm0 <- lm(LOGSAL ~ GENDER + MINORITY + JOBCAT, data = wages) e0 <- residuals(lm0) lm1 <- lm(e0 ~ EDUC + GENDER + MINORITY + JOBCAT, data = wages) e1 <- summary(lm1) e1rsq <- e1$r.squared test1 <- nrow(wages) * e1rsq ``` ````markdown ```{r, echo = FALSE, result = 'asis'} cat( "Under the null hypothesis with degree of freedom equal to 1,", " the test statistic is ",round(test1,4), " and critical value is ", round(qchisq(0.95,1),4) ) ``` ```` Under the null hypothesis with degree of freedom equal to 1 , the test statistic is 125.7683 and the critical value is 3.8415. ] --- ## Does Education affect annual salary? .left-column[ `\(H_{0}: \beta_{educ} = 0\)` `\(H_{1}: \beta_{educ} \neq 0\)` ] .right-column[ ```r reject_h0 <- test1 > round(qchisq(0.95, 1), 4) ``` Since the test statistic for LM1 is `` `r if(reject_h0) "greater" else "smaller" ` `` greater than the critical, therefore we `` `r if(reject_h0) "" else " cannot" ` `` reject the null hypothesis and conclude that `\(\beta_{educ}\)` is `` `r if(reject_h0) "" else " not"` `` significant at 5% level. Since the test statistic for LM1 is greater than the critical, therefore we reject the null hypothesis and conclude that `\(\beta_{educ}\)` is significant at 5% level.] --- ## Easy? Let's do another one! ### Does Minority and Job category affect salary? .left-column[ `\(H_{0} : \beta_{minority} =\)` `\(\beta_{jobcat}=0\)` `\(H_{1} : \beta_{minority} \neq 0\)` or `\(\beta_{jobcat} \neq 0\)` ] .right-column[ ```r lmrest <- lm(formula = LOGSAL ~ EDUC + GENDER, data = wages) e2 <- summary(lmrest)$residuals lme2 <- lm(e2 ~ EDUC + GENDER + MINORITY + JOBCAT, data = wages) e2.sqr <- summary(lme2)$r.squared test2 <- nrow(wages) * e2.sqr *print("Under the null hypothesis with degree of freedom equal to 2") ``` ``` ## [1] "Under the null hypothesis with degree of freedom equal to 2" ``` ```r *print(paste0("the test statistic is ", round(test2, 4))) ``` ``` ## [1] "the test statistic is 208.745" ``` ```r *print(paste0("The critical value is ", round(qchisq(0.95, 2), 4))) ``` ``` ## [1] "The critical value is 5.9915" ``` ] --- ### Does Minority and Job category affect salary? .left-column[ `\(H_{0} : \beta_{minority} =\)` `\(\beta_{jobcat}=0\)` `\(H_{1} : \beta_{minority} \neq 0\)` or `\(\beta_{jobcat} \neq 0\)` ] .right-column[ ```r reject_h0.2 <- test2 > round(qchisq(0.95, 2), 4) ``` - Since the test statistic for LM1 is `` `r if(reject_h0.2) "greater" else "smaller"` `` greater than the critical, therefore we `` `r if(reject_h0.2) "" else " cannot" ` `` reject the null hypothesis and conclude that `` `r if(reject_h0.2) "at least one of" else "none of" ` `` at least one of `\(\beta_{minority}\)` and `\(\beta_{jobcat}\)` is significant at 5% level. - Since the test statistic for LM1 is greater than the critical, therefore we reject the null hypothesis and conclude that at least one of `\(\beta_{minority}\)` and `\(\beta_{jobcat}\)` is significant at 5% level.] --- class: center, middle ![](https://media.giphy.com/media/HufOeXwDOInlK/giphy.gif) --- # Bayesian Approach - Prior Adjustments Bayes' Rule: `\(p(\theta|Y) \propto L(\theta|Y)p(\theta)\)` The posterior distribution is proportion to the kernel of posterior distribution times the distribution of the prior distribution. -- We have a time series for Australian real GDP from the Australian Real-Time Macroeconomic Database containing T=230 observations on the quarterly data from quarter 3 of 1959 to the last quarter of 2016. <img src="index_files/figure-html/unnamed-chunk-7-1.png" width="648" style="display: block; margin: auto;" /> .footnote[Data provided by Tomasz Wozniak in Macroeconometrics ECOM90007] --- ## Setting Prior distributions parameters - Question: "Set the parameters of the natural-conjugate prior distribution and motivate the values that you choose." - Random Walk with drift process: `\(logGDP_{t}=\mu_{0}+\alpha logGDP_{t-1}+u_{t}\)` - `\(\alpha\)`=1 - `\(u_{t} \sim \mathcal{N}(0,\sigma^{2})\)` - `\(P(\sigma^{2})\sim \mathcal{IG_{2}}(s,\nu)\)` - Priors: `\(\mu_{0}\)`, `\(\alpha\)`, `\(\sigma^2\)`, s, `\(\nu\)` -- .center[<img src="https://media.giphy.com/media/xT0xeuOy2Fcl9vDGiA/giphy.gif" style="width:30%"/>] --- ## First set of priors testing - `\(P(\beta=\begin{bmatrix}\mu_{0} \\ \alpha \end{bmatrix}|\sigma^2)\sim \mathcal{N}(\begin{bmatrix}0.01\\1\end{bmatrix},\sigma^2\begin{bmatrix}1&0\\0&10\end{bmatrix})\)` - The sample mean of `\(\mu_{0}\)` with 5000 draws is 0.0148564 and the variance is 0.011913. - The sample mean of `\(\alpha\)` with 5000 draws is 0.999454 and the variance is 0.000082. - The sample mean of `\(\sigma^2\)` with 5000 draws is 0.017256 and the variance is 0.0000026. <img src="index_files/figure-html/unnamed-chunk-10-1.png" width="648" style="display: block; margin: auto;" /> --- ## Adjust prior parameters - `\(P(\beta=\begin{bmatrix}\mu_{0} \\ \alpha \end{bmatrix}|\sigma^2)\sim \mathcal{N}(\begin{bmatrix}0.01\\1\end{bmatrix},\sigma^2\begin{bmatrix}0.1&0\\0&1\end{bmatrix})\)` - The sample mean of `\(\mu_{0}\)` with 5000 draws is 0.0024582 and the variance is 0.001686. - The sample mean of `\(\alpha\)` with 5000 draws is 1.00048 and the variance is 0.000012. - The sample mean of `\(\sigma^2\)` with 5000 draws is 0.017258 and the variance is 0.0000026. <img src="index_files/figure-html/unnamed-chunk-12-1.png" width="648" style="display: block; margin: auto;" /> --- ## Adjust prior parameters - `\(P(\beta=\begin{bmatrix}\mu_{0} \\ \alpha \end{bmatrix}|\sigma^2)\sim \mathcal{N}(\begin{bmatrix}0\\1\end{bmatrix},\sigma^2\begin{bmatrix}1&0\\0&1\end{bmatrix})\)` - The sample mean of `\(\mu_{0}\)` with 5000 draws is 0.0114882 and the variance is 0.011913. - The sample mean of `\(\alpha\)` with 5000 draws is 0.999733 and the variance is 0.000082. - The sample mean of `\(\sigma^2\)` with 5000 draws is 0.017257 and the variance is 0.0000026. <img src="index_files/figure-html/unnamed-chunk-14-1.png" width="648" style="display: block; margin: auto;" /> --- ## Behind the Scenes - The sample mean of `\(\mu_{0}\)` with 5000 draws is `` `r round(mean(blogau$V1),8)` `` and the variance is `` `r round(var(blogau$V1),6)` ``. - The sample mean of `\(\alpha\)` with 5000 draws is `` `r round(mean(blogau$V2),6)` `` and the variance is `` `r round(var(blogau$V2),8)` ``. - The sample mean of `\(\sigma^2\)` with 5000 draws is`` `r round(mean(blogau$sigmasq),6)` `` and the variance is `` `r round(var(blogau$sigmasq),8)` ``. <!-- ````markdown --> <!-- ```{r} --> <!-- post.mu0 <- ggplot(data=blogau, aes(x=V1)) + --> <!-- geom_histogram(binwidth=0.01, colour="black", fill="white")+ --> <!-- ggtitle("Distribution of mu0")+ --> <!-- xlab("mu0") --> <!-- post.alpha <- ggplot(data=blogau, aes(x=V2)) + --> <!-- geom_histogram(binwidth=0.001, colour="black", fill="white")+ --> <!-- ggtitle("Distribution of Alpha")+ --> <!-- xlab("alpha") --> <!-- post.sigma<- ggplot(data=blogau, aes(x=sigmasq)) + --> <!-- geom_histogram(binwidth=0.001, colour="black", fill="white")+ --> <!-- ggtitle("Distribution of Sigma Squared")+ --> <!-- xlab("sigmasq") --> <!-- ggarrange(post.mu0, post.alpha, post.sigma + rremove("x.text"), --> <!-- labels = c("A", "B", "C"), --> <!-- ncol = 3, nrow = 1) --> <!-- ``` --> <!-- ```` --> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> ```r shh, witchcraft here. Why do I need this chunk to advance to next slide? @yihui, please send help! ``` --- ## Outputting Plots ### R Script ```r pdf(file="mu0plot.pdf", height=12, width=9) ggplot(data=blogau, aes(x=V1)) + geom_histogram(binwidth=0.01, colour="black", fill="white")+ ggtitle("Distribution of mu0")+ xlab("mu0") dev.off() ``` -- ### R Markdown ````markdown ```{r,echo=FALSE,fig.height=12,fig.width=9,dev="pdf"} ggplot(data=blogau, aes(x=V1)) + geom_histogram(binwidth=0.01, colour="black", fill="white")+ ggtitle("Distribution of mu0")+ xlab("mu0") ``` ```` --- class: center, middle # Demonstrations [![](https://media.giphy.com/media/xT9DPIBYf0pAviBLzO/giphy.gif)](https://github.com/DanyangDai/rladies-melbourne-rmarkdown/) --- # Reference Alison Hill, June 2019, R-Ladies xaringan theme: [<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"></path></svg> ](https://alison.rbind.io/project/rladies-xaringan/) Professor Chris Skeels, S1 2020,Econometrics ECOM90013, University of Melbourne Guidotti, E., Ardia, D., (2020), "COVID-19 Data Hub", Journal of Open Source Software 5(51):2376, doi:10.21105/joss.02376. Tomasz Wozniak, S1 2020, Macroeconometrics ECOM90007, University of Melbourne --- # Sources [<svg viewBox="0 0 576 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M542.22 32.05c-54.8 3.11-163.72 14.43-230.96 55.59-4.64 2.84-7.27 7.89-7.27 13.17v363.87c0 11.55 12.63 18.85 23.28 13.49 69.18-34.82 169.23-44.32 218.7-46.92 16.89-.89 30.02-14.43 30.02-30.66V62.75c.01-17.71-15.35-31.74-33.77-30.7zM264.73 87.64C197.5 46.48 88.58 35.17 33.78 32.05 15.36 31.01 0 45.04 0 62.75V400.6c0 16.24 13.13 29.78 30.02 30.66 49.49 2.6 149.59 12.11 218.77 46.95 10.62 5.35 23.21-1.94 23.21-13.46V100.63c0-5.29-2.62-10.14-7.27-12.99z"></path></svg> R Markdown Cheat Sheet ](https://rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf) [<svg viewBox="0 0 448 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M448 360V24c0-13.3-10.7-24-24-24H96C43 0 0 43 0 96v320c0 53 43 96 96 96h328c13.3 0 24-10.7 24-24v-16c0-7.5-3.5-14.3-8.9-18.7-4.2-15.4-4.2-59.3 0-74.7 5.4-4.3 8.9-11.1 8.9-18.6zM128 134c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm0 64c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm253.4 250H96c-17.7 0-32-14.3-32-32 0-17.6 14.4-32 32-32h285.4c-1.9 17.1-1.9 46.9 0 64z"></path></svg> R Markdown: The Definitive Guide ](https://bookdown.org/yihui/rmarkdown/) [<svg viewBox="0 0 384 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M202.021 0C122.202 0 70.503 32.703 29.914 91.026c-7.363 10.58-5.093 25.086 5.178 32.874l43.138 32.709c10.373 7.865 25.132 6.026 33.253-4.148 25.049-31.381 43.63-49.449 82.757-49.449 30.764 0 68.816 19.799 68.816 49.631 0 22.552-18.617 34.134-48.993 51.164-35.423 19.86-82.299 44.576-82.299 106.405V320c0 13.255 10.745 24 24 24h72.471c13.255 0 24-10.745 24-24v-5.773c0-42.86 125.268-44.645 125.268-160.627C377.504 66.256 286.902 0 202.021 0zM192 373.459c-38.196 0-69.271 31.075-69.271 69.271 0 38.195 31.075 69.27 69.271 69.27s69.271-31.075 69.271-69.271-31.075-69.27-69.271-69.27z"></path></svg> Stack Overflow ](https://stackoverflow.com/questions) [<svg viewBox="0 0 581 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M581 226.6C581 119.1 450.9 32 290.5 32S0 119.1 0 226.6C0 322.4 103.3 402 239.4 418.1V480h99.1v-61.5c24.3-2.7 47.6-7.4 69.4-13.9L448 480h112l-67.4-113.7c54.5-35.4 88.4-84.9 88.4-139.7zm-466.8 14.5c0-73.5 98.9-133 220.8-133s211.9 40.7 211.9 133c0 50.1-26.5 85-70.3 106.4-2.4-1.6-4.7-2.9-6.4-3.7-10.2-5.2-27.8-10.5-27.8-10.5s86.6-6.4 86.6-92.7-90.6-87.9-90.6-87.9h-199V361c-74.1-21.5-125.2-67.1-125.2-119.9zm225.1 38.3v-55.6c57.8 0 87.8-6.8 87.8 27.3 0 36.5-38.2 28.3-87.8 28.3zm-.9 72.5H365c10.8 0 18.9 11.7 24 19.2-16.1 1.9-33 2.8-50.6 2.9v-22.1z"></path></svg> RStudio Community ](https://community.rstudio.com) [<svg viewBox="0 0 640 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z"></path></svg> Workshops: Communicating with Data via R Markdown by Emi Tanaka](https://rmd-combine-2019.netlify.app) ### Recent Talks about R Markdown on the 2020 RStudio Conference: [<svg viewBox="0 0 352 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M96.06 454.35c.01 6.29 1.87 12.45 5.36 17.69l17.09 25.69a31.99 31.99 0 0 0 26.64 14.28h61.71a31.99 31.99 0 0 0 26.64-14.28l17.09-25.69a31.989 31.989 0 0 0 5.36-17.69l.04-38.35H96.01l.05 38.35zM0 176c0 44.37 16.45 84.85 43.56 115.78 16.52 18.85 42.36 58.23 52.21 91.45.04.26.07.52.11.78h160.24c.04-.26.07-.51.11-.78 9.85-33.22 35.69-72.6 52.21-91.45C335.55 260.85 352 220.37 352 176 352 78.61 272.91-.3 175.45 0 73.44.31 0 82.97 0 176zm176-80c-44.11 0-80 35.89-80 80 0 8.84-7.16 16-16 16s-16-7.16-16-16c0-61.76 50.24-112 112-112 8.84 0 16 7.16 16 16s-7.16 16-16 16z"></path></svg> One R Markdown Document, Fourteen Demos by Yihui Xie ](https://yihui.org/en/2020/02/rstudio-conf-2020/) [<svg viewBox="0 0 576 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M576 240c0-23.63-12.95-44.04-32-55.12V32.01C544 23.26 537.02 0 512 0c-7.12 0-14.19 2.38-19.98 7.02l-85.03 68.03C364.28 109.19 310.66 128 256 128H64c-35.35 0-64 28.65-64 64v96c0 35.35 28.65 64 64 64h33.7c-1.39 10.48-2.18 21.14-2.18 32 0 39.77 9.26 77.35 25.56 110.94 5.19 10.69 16.52 17.06 28.4 17.06h74.28c26.05 0 41.69-29.84 25.9-50.56-16.4-21.52-26.15-48.36-26.15-77.44 0-11.11 1.62-21.79 4.41-32H256c54.66 0 108.28 18.81 150.98 52.95l85.03 68.03a32.023 32.023 0 0 0 19.98 7.02c24.92 0 32-22.78 32-32V295.13C563.05 284.04 576 263.63 576 240zm-96 141.42l-33.05-26.44C392.95 311.78 325.12 288 256 288v-96c69.12 0 136.95-23.78 190.95-66.98L480 98.58v282.84z"></path></svg> How Rmarkdown changed my life by Professor Rob J Hyndman ](https://robjhyndman.com/seminars/rmarkdown/) [<svg viewBox="0 0 640 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M624 416H381.54c-.74 19.81-14.71 32-32.74 32H288c-18.69 0-33.02-17.47-32.77-32H16c-8.8 0-16 7.2-16 16v16c0 35.2 28.8 64 64 64h512c35.2 0 64-28.8 64-64v-16c0-8.8-7.2-16-16-16zM576 48c0-26.4-21.6-48-48-48H112C85.6 0 64 21.6 64 48v336h512V48zm-64 272H128V64h384v256z"></path></svg> These slides!](https://rmarkdown-rladiesmelbourne.netlify.app/) --- class: center, middle # Questions? ![](https://media.giphy.com/media/5XRB3Ay93FZw4/giphy.gif) --- class: center, middle # Stay in Touch .center[<img src="https://media.giphy.com/media/RiykPw9tgdOylwFgUe/giphy.gif" style="width:30%"/>] [<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z"></path></svg> danyangd@student.unimelb.edu.au](mailto:danyangd@student.unimelb.edu.au) [<svg viewBox="0 0 448 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"></path></svg> https://www.linkedin.com/in/danyang-dai-7529b4152/](https://www.linkedin.com/in/danyang-dai-7529b4152/)