Primeiro arquivo R+Mardown ======================================================== This is an R Markdown document. Markdown is a simple formatting syntax for authoring web pages (click the **MD** toolbar button for help on Markdown). When you click the **Knit HTML** button a web page will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this: Abaixo está o chunk que configura o prefixo das figuras e a largura do código. No entando esse chunk não será exibido. ```{r setup, include=FALSE} opts_chunk$set(fig.path="figure/prefix-", tidy=FALSE) options(width=70) ``` Abaixo o primeiro chunk que será exibido, o resumo do data.frame cars. ```{r first} ##----------------------------------------------------------------------------- summary(cars) ``` You can also embed plots, for example: ```{r graph, fig.width=7, fig.height=6} ##----------------------------------------------------------------------------- plot(cars, main="grafico") ``` Uma lista numerada: 1. Primeiro item; 2. Segundo item; 3. Terceiro item. Uma lista de tópicos: * Um; * Dois; * Três. Uma lista de tópicos aninhada. * Bullet 1 * Bullet 2 * Bullet 2a * Bullet 2b * Bullet 3 Uma lista numerada aninhada. 1. Dog 1. German Shepherd 2. Belgian Shepherd 1. Malinois 2. Groenendael 3. Tervuren 2. Cat 1. Siberian 2. Siamese Uma lista mista. * First level unordered list item 1. Second level ordered list item Inserindo um link no documento. [text to link](http://example.com/) Inserindo uma tabela. | Tables | Are | Cool | | ------------- |:-------------:| -----:| | col 3 is | right-aligned | $1600 | | col 2 is | centered | $12 | | zebra stripes | are neat | $1 | Sem mostrar o input usando `echo=FALSE`. ```{r, echo=FALSE} summary(iris) ``` Sem mostrar o output usando `results="hide"`. ```{r, results="hide"} summary(iris) ``` Sem avaliar o código. ```{r, eval=FALSE} rnorm(10000) ``` ```{r sumvalor, include=FALSE} x <- mean(iris$Sepal.Length) s <- sd(iris$Sepal.Length) nota <- 5.8 status <- ifelse(nota>=7, "aprovado", "não aprovado") ``` A média do comprimento de sépalas foi de `r x` e o desvio-padrão de `r s`. O aluno obteve nota `r nota` e postanto foi **`r status`**. A média amostral $latex \bar{x}$ é $$latex \bar{x} = \frac{\sum_{i=1}^{n} X_i}{n}. $$