Skip to content

Instantly share code, notes, and snippets.

@pachevalier
Last active August 29, 2015 13:56
Show Gist options
  • Save pachevalier/9132601 to your computer and use it in GitHub Desktop.
Save pachevalier/9132601 to your computer and use it in GitHub Desktop.
R markdown, source and graphs
ggplot(data = df, aes(x = x, y = y)) + geom_point()
```{r data, echo=FALSE}
library("ggplot2")
library("knitr")
df <- data.frame(x = rnorm(100), u = rnorm(100))
df$y <- 1 + df$x + df$u
```
```{r test, echo=FALSE, results='asis'}
read_chunk('gr.R')
```
```{r test2, echo=FALSE, results='asis'}
source('gr.R')
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment