cells | R Documentation |
These functions allow one to obtain the XML nodes in a work sheet and then one can extract the values directly or modify any of them.
cells(sheet, notEmpty = TRUE,
xquery = if (notEmpty)
"//x:sheetData/*/x:c[x:v or x:is]"
else
"//x:sheetData/*/x:c",
cells = getNodeSet(sheet@content, xquery, "x"))
sheet |
the |
notEmpty |
a logical value that controls whether
we only return cells that contain a value,
or if |
xquery |
the XPath query string that is used to obtain the cell nodes |
cells |
a list of the cell nodes. This is very rarely ever supplied by the caller. |
A list of XML nodes return via getNodeSet
.
Duncan Temple Lang
w = workbook(system.file("SampleDocs", "Workbook1.xlsx", package = "RExcelXML"))
sh = w[[1]]
k = cells(sh)
names(k)
# those cells in column A.
k[grepl("^A", names(k))]
# Just the cells in column 'A' via XPath
k = cells(sh, xquery = "//x:c[starts-with(@r, 'A')]")
names(k)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.