# NOT RUN {
# Create a new document
doc = reveal( title = "title" )
# add a page where to add R plots with title 'Plots'
doc = addSlide( doc )
# Add a base plot
doc = addPlot( doc, fun = plot
, x = rnorm( 100 )
, y = rnorm (100 )
, main = "base plot main title"
)
myplot = qplot(Sepal.Length, Petal.Length, data = iris, color = Species, size = Petal.Width, alpha = I(0.7))
doc = addPlot( doc
, print
, width = 6, height = 7
, x = myplot #this argument MUST be named, print is expecting argument 'x'
)
# write the reveal object in a directory
reveal.directory <- "reveal_doc"
reveal.files = writeDoc( doc, directory = reveal.directory )
# }
Run the code above in your browser using DataLab