read.xls {gregmisc}R Documentation

Read Excel files

Description

Reads a Microsoft Excel file into a data frame

Usage

read.xls(xls, sheet=1, verbose=FALSE, ...)

Arguments

xls name of the Microsoft Excel file
sheet number of sheet within the Excel file from which data are to be read
verbose logical flag idicating whether details should be printed as the file is processed.
... additional arguments to read.table. The defaults of read.csv are used.

Details

This function works translating the named Microsoft Excel file into a temporary .csv file, using Greg Warnes' xls2csv perl script (installed as part of the gregmisc package).

Note that, in the conversion to csv, strings will be quoted. This is a problem if you are trying to use the comment.char option of read.table since the first character of all lines (including comment lines) will be """ after conversion.

Value

a data frame

Author(s)

Jim Rogers james_a_rogers@groton.pfizer.com, modified and extenede by Gregory R. Warnes gregory_r_warnes@groton.pfizer.com.

References

http://www.analytics.washington.edu/statcomp/downloads/xls2csv

See Also

read.csv

Examples


   # iris.xls is included in the gregmisc package for use as an example
   xlsfile <- file.path(.path.package('gregmisc'),'xls','iris.xls')
   xlsfile

   iris <- read.xls(xlsfile)  
   head(iris)  # look at the top few rows

[Package Contents]