Learn R Programming

ReporteRs (version 0.2)

addParagraph.reveal: Insert a paragraph into an reveal object

Description

Insert paragraph(s) of text into a reveal object

Usage

# S3 method for reveal
addParagraph (doc, value,
    stylename = "text-primary", parent.type = "div", ...)

Arguments

doc

Object of class "reveal" where paragraph has to be added

value

character vector containing texts to add OR an object of class set_of_paragraphs.

stylename

value of the named style to apply to paragraphs in the reveal document. See http://getbootstrap.com/css and look for 'class' examples.

parent.type

a character value ; parent tag for added paragraph. optional. If 'div', paragraph is normal ; if 'ol', paragraph will be an ordered list ; if 'ul', paragraph will be an unordered list ; if 'pre', paragraph will be a preformatted text area.

...

further arguments, not used.

Value

an object of class "reveal".

See Also

reveal, addTitle.reveal , addParagraph

Examples

Run this code
# NOT RUN {
# Create a new document
doc = reveal( title = "title" )

# add a page where to add R outputs with title 'page example 1'
doc = addSlide( doc )

# Add "Hello World" into the document doc
doc <- addParagraph(doc, "Hello Word!", stylename = "text-primary", parent.type = "div")

# add a page where to add R outputs with title 'page example 2'
doc = addSlide( doc )

# Add into the document : "My tailor is rich" and "Cats and Dogs"
# format some of the pieces of text
pot1 = pot("My tailor", textProperties(color="red") ) + " is " + pot("rich", textProperties(font.weight="bold") )
my.pars = set_of_paragraphs( pot1 )
pot2 = pot("Cats", textProperties(color="red") ) + " and " + pot("Dogs", textProperties(color="blue") )
my.pars = set_of_paragraphs( pot1, pot2 )

# used parent.type = "ul" so that paragraphs will be preceded by bullet points
doc <- addParagraph(doc, my.pars, stylename = "text-primary", parent.type = "ul")

# 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