[R] Importing Large Dataset into Excel

Wayne Aldo Gavioli wgavioli at fas.harvard.edu
Wed Dec 12 04:15:29 CET 2007


Hello all,


I seem to be having a problem importing a data set from Excel into R.  I'm using
the "read.table" command to import the data with the following line of code:

> newborn<-read.table("newborn edit.csv", header=T, sep=",")


where "newborn edit.csv" is the name of the file.  Unfortunately, I'm getting
back the following error message:


"Error in scan(file,, what, nmax, sep, dc, quote, skip, nlines, na.string, :
line 528 did not have 44 elements"


As far as I can tell, line 528 of the spreadsheet table does have the same
number of elements as the other rows - by chance can this error message mean
anything else?  Also, is there an easier way to import data from R into Excel
using a single line of R code?


Thanks,


Wayne



More information about the R-help mailing list