addList | R Documentation |
This function adds a Word list to a word processing document. It takes the R object and attempts to represent it as a list.
In the future, we should make this generic. Howver, the
makeList
function is the ont that creates the XML
representation of the R object. So making this generic is
more releated to doc
and node
and being able to add
to a parsed XML document or to a particular place in the document,
rather than just the archive. However, one can do this via node
now.
addList(obj, doc, node = xmlRoot(doc[[getDocument(doc)]]), id = NA, lvl = 0, ..., inline = TRUE)
obj |
the R object which is to be displayed as a list in the Word document. |
doc |
the Word document, i.e. of class |
node |
the node in the primary XML document within the Word archive at which to put this new node. The new list is added as a child of this node. |
id |
the identifier for the list that is used in the Word meta data to index this list. |
lvl |
the level of the list, i.e. the level of nesting. |
... |
additional parameters that are passed to the
|
inline |
a logical value passed to |
The side-effect of updating the archive is the primary purpose of this function.
If we add methods for this function to update the parsed XML document, the archive will not be updated directly.
Duncan Temple Lang
doc = wordDoc("doesNotExist.docx", create = TRUE)
addList(c("Duncan", "John", "Naras"), doc)
lists(doc) # doesn't work yet, but the content is display.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.