read.xlsx | R Documentation |
This function and its methods provide a high-level
mechanism for reading the contents of a modern (xlsx)
Excel document and all of its worksheets.
It is similar to read.table
but is capable of reading multiple data frames
from a single file. For this reason, it does not make sense
to specify classes for the columns as they do not necessarily
apply to all of the worksheets.
read.xlsx(doc, which = NA, na = logical(), header = NA, skip = 0L, ..., as.list = FALSE)
doc |
the Excel document. This can be the name of the
xlsx file, the |
which |
an optional vector that is used to specify a subset of the worksheets to be read. This allows the caller to skip work sheets that are not of interest |
na |
an optional value or vector of values that is used to identify cell values that
should be mapped to |
header |
a logical vector with an element for each sheet to be
read (or else it is recycled) that indicates whether a particular
sheet has column names in the first row of the actual sheet
data/cells. The concept of "first row" is further controlled by |
skip |
a number for each sheet to be read (see
|
... |
additional parameters for the methods |
as.list |
a logical value. This controls how
the contents of a workbook with a single worksheet is
returned. If this is |
Typically a list with as many elements as there are
worksheets within the workbook.
If as.list
is FALSE
and there is a single worksheet in
the workbook, the data frame for that worksheet is returned directly.
Duncan Temple Lang
f = system.file("SampleDocs", "Workbook1.xlsx", package = "RExcelXML")
read.xlsx(f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.