Skip to content

Instantly share code, notes, and snippets.

@averissimo
Last active November 26, 2018 15:51
Show Gist options
  • Save averissimo/e08a28e8aba88a8c313d74cd4625983e to your computer and use it in GitHub Desktop.
Save averissimo/e08a28e8aba88a8c313d74cd4625983e to your computer and use it in GitHub Desktop.
---
title: "Untitled"
output:
BiocStyle::html_document:
dev: "svg"
---
## Failing plots
```{r}
plot(1:10,-1:-10)
```
```{r pressure, echo=FALSE}
library(ggplot2)
df <- data.frame(
gp = factor(rep(letters[1:3], each = 10)),
y = rnorm(30)
)
ds <- plyr::ddply(df, "gp", plyr::summarise, mean = mean(y), sd = sd(y))
ggplot() +
geom_point(data = df, aes(gp, y)) +
geom_point(data = ds, aes(gp, mean), colour = 'red', size = 3) +
geom_errorbar(
data = ds,
aes(gp, mean, ymin = mean - sd, ymax = mean + sd),
colour = 'red',
width = 0.4
)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment