Worksheet-class | R Documentation |
This class is used to represent and individual worksheet within an Excel workbook/file. This corresponds to an individual data grid within the Excel interface.
Objects of this class are typically created indirectly and obtained
as the return values from calls to getSheet
and [[,Workbook,ANY,missing-method
.
content
:Object of class "XMLInternalDocument"
the parsed XML document that provides the content of the worksheet.
name
:Object of class "ZipArchiveEntry"
the
identifier for the top-level xlsx archive and the entry within
that corresponds to the worksheet. This allows us to resolve
material that is part of the worksheet, but contained elsewhere in
the xlsx archive, e.g. shared strings.
signature(x = "Worksheet", i = "missing", j =
"missing")
: access subsets of cells in the worksheet
signature(x = "Worksheet", i = "integer", j = "character")
: access subsets of cells in the worksheet
signature(x = "Worksheet", i = "numeric", j =
"numeric")
: assign values to one or more cells in the worksheet
signature(x = "Worksheet", i = "numeric", j = "character")
: ...
signature(x = "Workbook", i = "ANY", j = "ANY", value = "Worksheet")
: ...
signature(x = "Worksheet")
: compute the number of rows and columns within the worksheet
signature(doc = "Worksheet")
: the name of the
underlying XML document.
signature(x = "Worksheet")
: names of the columns
Duncan Temple Lang
excelDoc
, workbook
.
f = system.file("SampleDocs", "Workbook1.xlsx", package = "RExcelXML")
e = excelDoc(f)
w = workbook(e)
w[[1]]
names(w)
sh = w[[1]]
as(sh, "data.frame")
sh[1, "C"]
sh[1:2,]
sh = workbook( excelDoc( f ) )[[1]]
sh[1:2, compact = TRUE]
sh[1:2, "D", compact = TRUE]
sh[c(2, 4), ]
## Not run:
e = excelDoc("mine1.xlsx", create = TRUE)
sh = workbook(e)[[1]]
sh[1,1] = 10
sh[2,1] = 20
sh[4,1, asFormula = TRUE] = "SUM(A1:A2)"
sh[1, "D", asFormula = TRUE] = "SUM(A1:A2)"
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.