ReporteRs (version 0.1)

addParagraph: Add a paragraph into a document object

Description

Add a paragraph into a document object

Usage

addParagraph(doc, value, ...)

Arguments

doc

document object

value

character vector containing texts to add OR an object of class set_of_paragraphs. A set_of_paragraphs object is a container for pot objects.

...

further arguments passed to other methods

Value

a document object

Details

a paragraph is a set of texts that ends with an end of line('\n' in C). Read pot to see how to get different font formats. Trying to insert a '\n' will have no effect. If an end of line is required, a new paragraph is required.

See Also

docx, addParagraph.docx , pptx, addParagraph.pptx , html, addParagraph.html

Examples

Run this code
# NOT RUN {
# Add "Hello World" into the document doc
doc <- addParagraph(doc, "Hello Word!");

# 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 )
doc <- addParagraph(doc, my.pars )
# }

Run the code above in your browser using DataCamp Workspace