# NOT RUN {
#START_TAG_TEST
# Create a new document
doc = docx( title = "title" )
# add a title (level 1)
doc = addTitle( doc, "My first title", level = 1 )
# add another title (level 2)
doc = addTitle( doc, "My first sub-title", level = 2 )
doc <- addParagraph(doc, "Hello Word!", stylename = "Normal")
# Write the object in file "addTitle_example.docx"
writeDoc( doc, "addTitle_example.docx" )
#STOP_TAG_TEST
# }
Run the code above in your browser using DataLab