Peter Haschke



Back to the Index

Sample Code Snippet

I am trying to see if I can get knitr to work on this website. So the code below is just for testing purposes on my part.

rm(list = ls(all = TRUE))
library(ggplot2)
library(ggthemes)

X <-rnorm(1000)

ggplot() +
  geom_histogram(aes(X), fill = "steelblue", alpha = 0.5) +
  theme(plot.background = element_rect(fill = "#fdf6e3"))
## stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust
## this.

center

Brilliant.

This post is filed under category R, and contains the following tags: R, ggplot2.

Back to the Blog-Index