class: inverse, left, bottom background-image: url("img/fondo.jpg") background-size: cover # **Rmarkdown** ---- ## **<br/> Generación de informes** ### Orlando Joaqui-Barandica, PhD ### 2024 --- class: inverse, left, bottom background-image: url("img/Logo.jpg") background-size: cover --- .pull-left[ <br><br><br><br><br> <img src="img/gif1.gif" width="110%" /> ] <br><br><br><br><br> .pull-right[ # Orlando Joaqui-Barandica ### [www.joaquibarandica.com](https://www.joaquibarandica.com) *PhD.(C) in Industrial Engineering* *MSc. Applied Economics* *BSc. Statistics* ] --- class: inverse, middle, center # Por qué R-Markdown? --- class: bottom, center background-image: url(https://media.giphy.com/media/11fDMHAzihB8D6/source.gif) # `Crisis de reproducibilidad?` --- class: middle, center # Cambia tu modelo mental .pull-left[ ### Source ↔ output <img src="img/word.png" width="50%" /> ] .pull-right[ ### Source → output <img src="img/rmd-file.png" width="50%" /> ] --- class: middle, center # Cambia tu modelo mental .pull-left[ ### Source ↔ output <img src="img/haba-elise.jpg" width="50%" /> ] .pull-right[ ### Source → output <img src="img/doll.png" width="50%" /> ] --- class: middle, inverse, center # Misma ~~Muñeca~~ Fuente -- # Diferente ~~Vestido~~ Salida --- class: middle, center # `html_document` <img src="img/doll.png" width="40%" /> --- class: middle, center # Qué hay adentro? ![](img/doc-make.jpg) --- name: card0 background-image: url(img/card0.png) background-size: contain --- name: card1 background-image: url(img/card1.png) background-size: contain --- # Guarda las opciones de la salida en el YAML .pull-left[ ```yaml --- author: Your name here title: Your title here output: html_document --- ``` ```yaml --- author: Your name here title: Your title here output: html_document: toc: true toc_float: true theme: flatly --- ``` ] .pull-right[ <img src="img/orchestra.jpg" width="75%" style="display: block; margin: auto;" /> ] --- background-image: url(img/Single-rmd.png) background-size: contain --- background-image: url(img/Single-rmd1.png) background-size: contain --- background-image: url(img/Single-rmd2.png) background-size: contain --- background-image: url(img/Single-rmd3.png) background-size: contain --- class: middle center background-image: url(img/Single-knit1.png) background-size: contain -- <img src="img/Single-knit2.png" style=" position: absolute; width: 91%; top: -53px; right: 5px; "> -- <img src="img/Single-knit3.png" style=" position: absolute; width: 97%; top: -45px; right: -51px; "> --- # Formatos de salida .center[ <a href="https://rmarkdown.rstudio.com/docs/reference/index.html#section-output-formats" target="_blank"><img src="img/rmdbase-formats.png" width="40%" /></a> ] https://rmarkdown.rstudio.com/docs/reference/index.html#section-output-formats --- class: middle, center # Formatos de extensión de salida <img src="https://raw.githubusercontent.com/rstudio/hex-stickers/master/PNG/flexdashboard.png" width="32%" /><img src="https://raw.githubusercontent.com/rstudio/hex-stickers/master/PNG/bookdown.png" width="32%" /><img src="https://raw.githubusercontent.com/rstudio/hex-stickers/master/PNG/xaringan.png" width="32%" /> --- # <center>Headers</center> -- .pull-left[ ```markdown # HEADER 1 ## HEADER 2 ### HEADER 3 #### HEADER 4 ##### HEADER 5 ###### HEADER 6 ``` ] -- .pull-right[ # HEADER 1 ## HEADER 2 ### HEADER 3 #### HEADER 4 ##### HEADER 5 ###### HEADER 6 ] --- ![](img/rmd-nav.png) --- # <center>Text</center> -- .pull-left[ ```markdown Childhood **vaccines** are one of the _great triumphs_ of modern medicine. ``` ] -- .pull-right[ Childhood **vaccines** are one of the _great triumphs_ of modern medicine. ] --- class: top # <center>Lists</center> -- .pull-left[ ```markdown Indeed, parents whose children are vaccinated no longer have to worry about their child's death or disability from: - whooping cough, - polio, - diphtheria, - hepatitis, or - a host of other infections. Vaccines are the most cost-effective health care interventions there are. We have three new, extremely effective vaccines to roll out in developing countries: 1. pneumonia 1. rotavirus 1. meningitis A ``` ] -- .pull-right[ Indeed, parents whose children are vaccinated no longer have to worry about their child's death or disability from: - whooping cough, - polio, - diphtheria, - hepatitis, or - a host of other infections. Vaccines are the most cost-effective health care interventions there are. We have three new, extremely effective vaccines to roll out in developing countries: 1. pneumonia 1. rotavirus 1. meningitis A ] --- # <center>Images</center> -- ```markdown Este es un ejemplo respecto a las figuras ![](https://www.joaquibarandica.com/media/skill_hu5e0817b3199504e96bc15346cd22079f_177624_1200x1200_fit_q99_lanczos.jpg) ``` -- Este es un ejemplo respecto a las figuras ![](./img/Librerias.jpg) --- # <center>Links</center> -- ```markdown [Photo](https://www.joaquibarandica.com/media/skill_hu5e0817b3199504e96bc15346cd22079f_177624_1200x1200_fit_q99_lanczos.jpg) Este es un ejemplo respecto a las figuras ![](https://www.joaquibarandica.com/media/skill_hu5e0817b3199504e96bc15346cd22079f_177624_1200x1200_fit_q99_lanczos.jpg) ``` -- [Photo](https://www.joaquibarandica.com/media/skill_hu5e0817b3199504e96bc15346cd22079f_177624_1200x1200_fit_q99_lanczos.jpg) Este es un ejemplo respecto a las figuras ![](./img/Librerias.jpg) --- # Chunk Una vez que controlamos como poner títulos, subtítulos y cabeceras y texto, podemos incluir análisis y resultados de R en el informe o tablero. Para ello debemos escribir el codigo de R entre una cabecera y pie que permite interpretar la sintáxis de `R` incluyendo un trozo o `chunk`: .pull-left[ ```` ```{r} x <- 3 + 4 ``` ```` Este es un ejemplo de **chunk** ] .pull-right[ <img src="img/chunk.png" width="50%" /> ] --- # Opciones de los chunk La salida de chunk se puede personalizar con las opciones de a traves de argumentos establecidos.En la Guía de referencia de R Markdown se encuentra una lista completa de las opciones de los chunk. Los argumentos más comunes son los siguientes: * **include = FALSE** evita que el código y los resultados aparezcan en el archivo terminado. R Markdown todavía ejecuta el código en el fragmento, y los resultados pueden ser utilizados por otros fragmentos. echo = FALSE impide el código, pero no aparecen los resultados en el archivo terminado. Esta es una forma útil de incrustar figuras. * **message = FALSE** evita que los mensajes generados por el código aparezcan en el archivo terminado. * **warning = FALSE** evita que las advertencias generadas por el código aparezcan en el final. * **fig.cap = "..."** agrega un título a los resultados gráficos. --- # message / warning ![](https://www.tidyverse.org/images/tidyverse_1.2.0/tidyverse_1-2-0_pkg_load.gif) --- # message / warning .pull-left[ ```` ```{r message=FALSE, warning=FALSE} library(tidyverse) ``` ```` ] .pull-right[ ] --- class: center, middle # Websites! --- class: middle .left-column[ # 🔗 ] .right-column[ <a href="https://rmarkdown.rstudio.com/" target="_blank"><img src="img/rmarkdown-site.png" width="80%" /></a> ] .footnote[https://rmarkdown.rstudio.com/] --- class: middle .left-column[ # 🔗 ] .right-column[ <a href="https://rmarkdown.rstudio.com/docs/" target="_blank"><img src="img/rmarkdowndocs-site.png" width="80%" /></a> ] .footnote[https://rmarkdown.rstudio.com/docs/] --- class: middle .left-column[ # 🎯 ] .right-column[ <a href="https://community.rstudio.com/c/R-Markdown" target="_blank"><img src="img/rmarkdowncommunity-site.png" width="80%" /></a> ] .footnote[https://community.rstudio.com/c/R-Markdown] --- class: middle .left-column[ # 🤖 ] .right-column[ <a href="https://rmarkdown.rstudio.com/lesson-6.html" target="_blank"><img src="https://raw.githubusercontent.com/rstudio/rmarkdown/gh-pages/lesson-images/params-1-hawaii.png" width="80%" /></a> ] .footnote[https://bookdown.org/yihui/rmarkdown/parameterized-reports.html,<br> https://rmarkdown.rstudio.com/lesson-6.html] --- class: inverse, center, middle background-color: #122140 .pull-left[ .center[ <br><br> # Gracias!!! <br> ### ¿Preguntas? <br> <img src="img/qr-code.png" width="49%" style="display: block; margin: auto;" /> ] ] .pull-right[ <br> <br> <img style="border-radius: 50%;" src="img/avatar.png" width="150px" /> ### [www.joaquibarandica.com](https://www.joaquibarandica.com)
orlando.joaqui@correounivalle.edu.co <img src="img/Logo.jpg" width="120%"> ] <br><br><br>