[R] Reading file

From: Val <valkremk_at_gmail.com>
Date: Wed, 27 Apr 2011 19:24:33 -0400


Hi all,

I am trying to read Excel file usingthe follwoing commnad

      library(RODBC)
     data=odbcConnectExcel(file.choose())
     sqlTables(data)

    Bdat=sqlFetch(data, "test")
    odbcClose(data)
    head(Bdat)
  1. The above script works if the Excel file is opened. If the excel file is not opened then I get the following message "External table is not in the expected format" and it stops.
  2. Instead of "(file.choose())" I wanted to use the following command data <- read.table('G:/test.xlsx", header=T)

  But it did not work again.
    Warning message:

       In read.table("G:/test.xlsx", header = T) :
       incomplete final line found by readTableHeader on 'G:/test.xlsx'

Did I miss something there?

Your help is highly appreciated

Val

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 27 Apr 2011 - 23:30:11 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 28 Apr 2011 - 02:40:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive