read.xls: Read a Microsoft Excel XLS file into a data frame

Description Usage Arguments Details Value Note Author(s)

View source: R/read.xls.R

Description

gdata provides the wonderful read.xls, but frequently if the last column is characters, then there is a single extra space in all words in the last column. This method over-rides gdata's, and fixes the last columns.

Usage

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

Arguments

xls

path to the Microsoft Excel file. Supports “http://”, “https://”, and “ftp://” URLs.

sheet

number of the sheet within the Excel file from which data are to be read

verbose

logical flag indicating whether details should be printed as the file is processed.

...

additional arguments to read.table. The defaults for read.csv() are used. hint: try check.names=FALSE

Details

This function works translating the named Microsoft Excel file into a temporary .csv or .tab file, using the xls2csv or xls2tab Perl script installed as part of the gdata package.

Caution: In the conversion to csv, strings will be quoted. This can be 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

Note

This extra space is probably due to different line endings.

Author(s)

Mark Cowley, 2009-01-22


drmjc/excelIO documentation built on Aug. 3, 2019, 5:16 p.m.