## This is an example R markdown file. If you are reading this in HTML format, click [here](example-markdown.Rmd) to see the original R markdown version, or to download it & view in a text editor. Converting a R markdown file to HTML (or a different format, such as PDF) is called *knitting*. If we intend to knit this file to html (hypertext markdown to read in a web browser), we can use any applicable html tag, or their [markdown equivalents](https://es.wikipedia.org/wiki/Markdown). However, we can also write in plain text sentences and paragraphs. Whenever we want to show code, we can use the following markdown style: ``` This is a code chunk ``` However when we knit this markdown file, this will not be executed in R. To write a code chunk that will be executed, we can use the following style: ```{r} x<-5 5 ``` Any function (other than interacting with plots, etc.) that we can realize in R, we can put in our markdown file & knit. For instance: ```{r} library(phytools) data(anoletree) plotTree(as.phylo(anoletree),type="fan",lwd=1,fsize=0.7) ``` This includes reading and writing to file, although we must be sure that we are currently in the same directory as the file, or that we specify the full path to the file. Code chunks that we do not want to evaluate we can write as follows: ```{r, eval=FALSE} library(devtools) install_github("liamrevell/phytools") ## install phytools from GitHub ``` To knit our file into .html we need to have the package [knitr](https://cran.r-project.org/web/packages/knitr/index.html) installed. Then we simply run: ```{r, eval=FALSE} library(knitr) knit2html("example-markdown.Rmd","example-markdown.html") ``` substituting our own input & desired output filenames. That's all there is to it.