Skip to content

Latest commit

 

History

History
54 lines (33 loc) · 1.37 KB

041-label-i.md

File metadata and controls

54 lines (33 loc) · 1.37 KB

My report

data(mtcars)

This example shows how to generate chunk labels dynamically with the brew syntax. It was motivated by the SO question: http://stackoverflow.com/q/12095113/559676

Generate report for each level of cylinder variable

6

hist(mtcars$mpg[mtcars$cyl == 6], main = paste(6, "cylinders"))

plot of chunk mpg-histogram-6

hist(mtcars$wt[mtcars$cyl == 6], main = paste(6, "cylinders"))

plot of chunk weight-histogam-6

4

hist(mtcars$mpg[mtcars$cyl == 4], main = paste(4, "cylinders"))

plot of chunk mpg-histogram-4

hist(mtcars$wt[mtcars$cyl == 4], main = paste(4, "cylinders"))

plot of chunk weight-histogam-4

8

hist(mtcars$mpg[mtcars$cyl == 8], main = paste(8, "cylinders"))

plot of chunk mpg-histogram-8

hist(mtcars$wt[mtcars$cyl == 8], main = paste(8, "cylinders"))

plot of chunk weight-histogam-8