[R] Errors in odbcConnectExcel()

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Sep 28 17:23:47 CEST 2005


This is entirely a function of the database format the ODBC Excel driver 
expects.  It is *not* an error in odbcConnectExcel as your subject 
accuses.

To use a spreadsheet as a database you need to have column names.

On Thu, 29 Sep 2005, [ISO-2022-JP] ÅÄÃæ Áï wrote:

> Dear R-help
>
> I would like to read Excel Spreadsheets using
> odbcConnectExcel()
> in RODBC, but data in the first row can not be read.
> For example, I tried to read Excel file 'Book1.xls' in the
>
> current Work Directory with the following data
> (Range("A1:B5") in Excel),
> 1 19
> 2 27
> 3 61
> 4 76
> 5 98
>
> My commands and the result are as follows.
>
>> library(RODBC)
>> Book1 <- odbcConnectExcel("Book1.xls")
>> X <- sqlQuery(Book1, "select * from [Sheet1$]")
>> X
>  F1 F2
> 1  2 27
> 2  3 61
> 3  4 76
> 4  5 98
>
> You can easily see that first line has gone.
> I also changed range to Range("A2:B6") in Excel,
> but the result did not change.
> What is the problem about my procedure?
>
> OS:Windows XP
> R :Version 2.1.1
>
> Sincerely yours.
>
> Satoshi
> sato_t1975 at yahoo.co.jp
>
> --------------------------------------
> Know more about Breast Cancer
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


More information about the R-help mailing list