class: center, middle, title-slide # Brief Instruction of Rmarkdown and Github ###
Dr. Xiaotao Shen
Postdoctoral at
Snyder lab
shenxt.info
shenxt@stanford.edu
### Stanford University School of Medicine ### 2020-03-17 --- layout: true background-image: url(logo.png) background-position: 100% 0% background-size: 12% <div class="my-footer"><span>Xiaotao Shen/www.shenxt.info</span></div> --- # Get started .pull-left[ ## The software we need * git * A github account * R and Rmarkdown * Typora ] .pull-right[ ## The R packages we need * `rmarkdown` * `blogdown` * `tinytex` * `xaringanthemer` * `xaringan` ] --- # Software ## git Please download git and install it in your mac, PC or Linux. (https://git-scm.com/) > Git is built in Mac and Linux. So you have no need to install it. Open your terminal (Mac and Linux) or Git bash: ```markdown git version ``` ## Github If you don't have a github accoiunt, please go to https://github.com/ and sign up. --- # Software ## R and Rmarkdown If you don't have R and Rmarkdown, please go https://www.r-project.org/ and https://rstudio.com/products/rstudio/download/, download and install them. ## Tytora .pull-left[ Typora is a **markdown** editor. Download it here https://typora.io/. ] .pull-right[ <iframe height=250 width=300 src="figures/beta.mp4"> ] --- # R packages Please open your Rstudio IDE and install the packages belows: ```r install.packages("rmarkdown") install.packages("blogdown") install.packages("xaringan") install.packages("xaringanthemer") ``` We also need LaTex, we can install it using `tinytext` in Rmarkdown: ```r install.packages("tinytex") tinytex::install_tinytex() # install TinyTeX ``` Install `HUGO` using `blogdown` in Rstudio: ```r blogdown::install_hugo() ``` --- # What is Markdown .right-column[ - Markdown is a lightweight markup language with plain-text-formatting syntax. - It's design allows it to be converted to many output formats. Such as HTML, PDF, word, PPT and so on. ] .left-column[ <img src="figures/markdown_logo.png" style="width: 50%" /> ] --- # Syntax .pull-left[ - Headers - Lists - Code blocks - Links - Emphasis - Images ] .pull-right[ - Highlighting - Tables - Blockquotes - Horizontal line - Equation ] --- # Headers .pull-left[ ### Markdown ```r # Heading level 1 ## Heading level 2 ### Heading level 3 #### Heading level 4 ##### Heading level 5 ###### Heading level 6 ``` ] .pull-right[ ### Rendered Output # Heading level 1 ## Heading level 2 ### Heading level 3 #### Heading level 4 ##### Heading level 5 ###### Heading level 6 ] --- # Lists/ordered Lists .pull-left[ ### Markdown ```r 1. First item 2. Second item 3. Third item 4. Fourth item ``` ] .pull-right[ ### Rendered Output 1. First item 2. Second item 3. Third item 4. Fourth item ] --- # Lists/unordered Lists .pull-left[ ### Markdown ```r - First item - Second item - Third item - Indented item - Indented item - Fourth item ``` ] .pull-right[ ### Rendered Output - First item - Second item - Third item - Indented item - Indented item - Fourth item ] --- # Code blocks .pull-left[ ### Markdown ````markdown ```{r, eval=FALSE, echo=TRUE} library(ggplot2) library(tidyverse) mtcars %>% ggplot(aes(x = gear, cyl)) + geom_point() + theme_bw() ``` ```` ] .pull-right[ ### Rendered Output ```r library(ggplot2) library(tidyverse) mtcars %>% ggplot(aes(x = gear, cyl)) + geom_point() + theme_bw() ``` ] --- # Images/local .pull-left[ ### Markdown ```r  ``` ] .pull-right[ ### Rendered Output  ] --- # Images/url .pull-left[ ### Markdown ```r  ``` ] .pull-right[ ### Rendered Output  ] --- # Emphasis .pull-left[ ### Markdown ````markdown Markdown is a good tool. **Markdown** is a good tool. *Markdown* is a good tool. ***Markdown*** is a good tool. ```` ] .pull-right[ ### Rendered Output Markdown is a good tool. **Markdown** is a good tool. *Markdown* is a good tool. ***Markdown*** is a good tool. ] --- # Tables .pull-left[ ### Markdown ```markdown | First name | Last name | Sex | | ------------- |-------------| -----| | Xiaotao |Shen | Male | | Chuchu | Wang | Female | ``` ] .pull-right[ ### Rendered Output | First name | Last name | Sex | | ------------- |-------------| -----| | Xiaotao |Shen | Male | | Chuchu | Wang | Female | ] --- # Blockquotes .pull-left[ ### Markdown ```markdown > Blockquotes are very handy in email to emulate reply text. > This line is part of the same quote. ``` ] .pull-right[ ### Rendered Output > Blockquotes are very handy in email to emulate reply text. > This line is part of the same quote. ] --- # Horizontal line .pull-left[ ### Markdown ```markdown *** ``` ] .pull-right[ ### Rendered Output This is a horizontal line. *** ] --- # IDE of markddown -- - <a href="http://note.youdao.com/" target="_blank" rel="noopener"><span>网易云笔记</span> </a> -- - [Trpora](https://typora.io/) -- - [Atom](https://atom.io/) -- - [Rstudio](https://rstudio.com/) -- - [Jupyper notebook](https://jupyter.org/) --- # More information... More information about `markdown`, `Rmarkdown`, `git&github` can be found here: https://jaspershen.github.io/r_cookbook/ The code of this Slides can be found here: https://github.com/jaspershen/current_topics_in_data_science_-and_omics