[R] Importing an Excel file

Marc Schwartz MSchwartz at MedAnalytics.com
Wed Jul 7 20:50:46 CEST 2004


On Wed, 2004-07-07 at 13:44, Marc Schwartz wrote:
> On Wed, 2004-07-07 at 13:21, Park, Kyong H Mr. RDECOM wrote:
> > Hello, R users,
> > I am  a very beginner of R and tried read.csv to import an excel file after
> > saving an excel file as csv. But it added alternating rows of fictitious NA
> > values after row number 16. When I applied read.delim, there were trailing
> > several commas at the end of each row after row number 16 instead of NA
> > values. Appreciate your help. 
> > 
> > Kyong


One other thing:

The default delimiting characters in read.csv() and read.delim() are NOT
the same.

The former uses a comma and the latter a TAB character. If you did not
change the defaults in Excel when you created your CSV file, that would
account for the difference behaviors upon import.

Be sure that the delimiting character in the R function you use properly
corresponds to the actual delimiting character in your CSV file.

Marc




More information about the R-help mailing list