class: title-slide, hide-count, hide-logo background-image: url("https://images.unsplash.com/photo-1617063033111-74cf600531d8?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1776&q=80") background-size: cover # .white.big-text[Dynamic Documents] ## .white[Session - 2] <br> <br> <br> <br> <br> .footnote[ .white[Image credits:][John Anvik](https://images.unsplash.com/photo-1617063033111-74cf600531d8?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1776&q=80) ] --- class: center # Open RStudio <img src="images/rstd-proj.png" width="75%" style="display: block; margin: auto;" /> --- class: center # Open RStudio <img src="images/rstd-proj-none.png" width="75%" style="display: block; margin: auto;" /> --- class: center # Open RStudio <img src="images/rstd-proj-folders.png" width="75%" style="display: block; margin: auto;" /> --- class: hide-logo, hide-count, left, middle background-image: url("images/project-logo.png") background-size: contain background-position: 110% # .big-text[RStudio<br>Project] --- background-image: url("images/r-projects.jpg") background-size: 62% background-position: 100% 80% # About RStudio Projects - "to divide your work into multiple contexts, each with their own: -- - working directory, -- - workspace, -- - history, and -- - source documents." .footnote[ [Source](https://support.rstudio.com/hc/en-us/articles/200526207-Using-Projects) & Artwork [Source](https://www.allisonhorst.com/) ] --- class: center, middle, hide-count # ๐ฅ Create RStudio Project in 4 Steps ๐ฅ --- class: center, middle # Create RStudio Project in 4 Steps <img src="images/rstd-proj-1.png" width="65%" style="display: block; margin: auto;" /> --- class: center, middle # Create RStudio Project in 4 Steps <img src="images/rstd-proj-2.png" width="65%" style="display: block; margin: auto;" /> --- class: center, middle # Create RStudio Project in 4 Steps <img src="images/rstd-proj-3.png" width="65%" style="display: block; margin: auto;" /> --- class: center, middle # Create RStudio Project in 4 Steps <img src="images/rstd-proj-4.png" width="65%" style="display: block; margin: auto;" /> --- class: center # Open RStudio Project <img src="images/rstd-project-name.png" width="75%" style="display: block; margin: auto;" /> --- class: center # Open RStudio Project <img src="images/rstd-project-path.png" width="75%" style="display: block; margin: auto;" /> --- class: center # Open RStudio Project <img src="images/rstd-project-path2.png" width="75%" style="display: block; margin: auto;" /> --- class: hide-count, middle, left, hide-logo background-image: url("images/logo-rmd.png") background-size: contain background-position: right # .big-text[R<br>Package] --- # About R Markdown: - "You bring your data, code, and ideas, and R Markdown renders your content into a polished document that can be used to: -- - Do data science interactively within the RStudio IDE, -- - Reproduce your analyses, -- - Collaborate and share code with others, and -- - Communicate your results with others." .footnote[ [Source](https://github.com/rstudio/rmarkdown) ] --- class: middle, center, hide-logo, hide-count <iframe src="https://player.vimeo.com/video/178485416?color=428bca" width="840" height="500" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> <p><a href="https://vimeo.com/178485416">What is R Markdown?</a> from <a href="https://vimeo.com/rstudioinc">RStudio, Inc.</a> on <a href="https://vimeo.com">Vimeo</a>.</p> --- class: center, middle, hide-logo, hide-count # ๐ฅHow to create R Markdown file?๐ฅ --- class: center # File `\(\rightarrow\)` New File `\(\rightarrow\)` R Markdown <img src="images/script-new.png" width="78%" style="display: block; margin: auto;" /> --- class: center # R Markdown <img src="images/script-options.png" width="65%" style="display: block; margin: auto;" /> --- class: center # R Markdown <img src="images/script-options1.png" width="65%" style="display: block; margin: auto;" /> --- class: center # R Markdown <img src="images/script-options2.png" width="65%" style="display: block; margin: auto;" /> --- class: center # R Markdown <img src="images/script-options3.png" width="65%" style="display: block; margin: auto;" /> --- class: center # Save your .Rmd file <img src="images/script-save.png" width="65%" style="display: block; margin: auto;" /> --- class: center # Name your .Rmd file <img src="images/script-title.png" width="85%" style="display: block; margin: auto;" /> --- class: center # Name your .Rmd file <img src="images/script-title1.png" width="85%" style="display: block; margin: auto;" /> --- class: center # Save your .Rmd file <img src="images/script-title2.png" width="85%" style="display: block; margin: auto;" /> --- class: center # Saved .Rmd file `\(\rightarrow\)` in RStudio Project <img src="images/script-saved.png" width="75%" style="display: block; margin: auto;" /> --- exclude: true class: center background-image: url("images/script-to-console1.png") background-size: 70% background-position: center bottom # Script file for writing the codes --- exclude: true class: center background-image: url("images/script-to-console2.png") background-size: 70% background-position: center bottom # Console to process the codes --- exclude: true class: center background-image: url("images/script-to-console3.png") background-size: 70% background-position: center bottom # R Script `\(\rightarrow\)` Console `\(\rightarrow\)` Output --- exclude: true class: center background-image: url("images/script-to-console4.png") background-size: 70% background-position: center bottom # R Script `\(\rightarrow\)` Console `\(\rightarrow\)` Output --- class: center, middle .pull-left[ <img src="images/rmd-input.png" width="100%" style="display: block; margin: auto;" /> ] .pull-right[ <img src="images/rmd-output.png" width="100%" style="display: block; margin: auto;" /> ] --- background-image: url("images/knit-html.png") background-size: contain background-position: center middle --- # R Markdown has 3 important parts: ##- .purple[YAML] ##- .orange[Code chunk] ##- .blue[Text] --- background-image: url("images/temp-yaml.png") background-size: cover background-position: left --- background-image: url("images/temp-chunk.png") background-size: cover background-position: left --- background-image: url("images/temp-text.png") background-size: cover background-position: left --- # ๐งถ Knit a R Markdown File - YAML options - Headings, subheadings, text & maths equations - Code Chunk - Include images - Include tables - Include plot - Themes - Multiple Output Formats - [eBook](https://bookdown.org/yihui/rmarkdown-cookbook/) --- class: center middle hide-count # ๐๐ฝโโ๏ธ๐โโ๏ธ<br>.big-text[Q&A] --- class: center, middle, inverse, hide-logo # Dynamic Visualisation<br>Using ggplot2 ### .orange[Next Module - 3]