Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/readFromExcel.r
Use this function to read data from an excel sheet into an R variable.
1 2 3 4 5 6 7 8 | readFromExcel(file = choose.files(), sheet = 1,
stringsAsFactors = default.stringsAsFactors(),
simplify = TRUE, drop = TRUE,
na.strings = c("", "NA", "#DIV/0!"),
zero.strings = "-",
convertFormattedNumbers = TRUE, ...,
header = TRUE, rowheader = FALSE,
pkg = c("XLConnect", "RODBC", "xlsx"))
|
file |
file to read from;
if not specified ( |
sheet |
sheet name or number to read from |
stringsAsFactors |
keep default |
simplify |
should matrices with length 1 in one of the dimensions be converted to vectors (TRUE)? |
drop |
if TRUE and one of the dimensions of the matrix has length 1, return a vector |
na.strings |
strings that you want considered to be NA |
zero.strings |
strings that you want considered to be zero |
convertFormattedNumbers |
do you want to eliminate dollar signs, commas, etc. in formatted numbers (TRUE) or read those cells as character values (FALSE)? |
header |
did you copy the column header(s) too? |
rowheader |
did you copy the row header(s)/name(s) too? |
pkg |
name of the package to use to read the actual cells. Choices are currently "XLConnect", "RODBC", "xlsx". |
... |
arguments to be passed to other methods |
Essentially a wrapper for other R packages that standardizes the argument list throughout the excelRio package.
An R object, either a data.frame, a matrix or a vector.
dmm
writeToCsv, readFromCsv, pasteFromExcel, copyToExcel
1 2 3 4 5 6 | # In Excel, save a sheet of data to a csv file, e.g., Book1.csv.
# Suppose the data was a table of data by accident year,
# with the accident years being in column A, thereby "naming" the rows of data.
# Back in R ...
### NOT RUN
# x <- readFromExcel("Book1.xlsx", rowheader = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.