site stats

Emrah Er

An R-based Research Notebook - Test

The following are from Tom Torsney-Weir’s blog (here’s the repo).

  • Simple MathJax and R example
1
1 + 1
## [1] 2
  • A more complex example with caching
1
2
3
x.vals <- runif(10)
y.vals <- runif(10)
plot(x.vals, y.vals)

plot of chunk test2

  • Another plotting example using ggplot
1
2
3
library(ggplot2)
c <- ggplot(mtcars, aes(y = wt, x = mpg, colour = factor(cyl)))
c + stat_smooth(method = lm) + geom_point()

plot of chunk test3

1
2
3
4
5
suppressPackageStartupMessages(library(googleVis))
## Table with embedded links
PopTable <- gvisTable(Population, options = list(width = 888, height = 450,
    page = "enable"))
print(PopTable, "chart")