Re: [R] missing values in document

From: S Ellison <>
Date: Wed, 30 Apr 2008 12:24:07 +0100

What exactly is on line 1743?

Genuinely empty cells will probably read as NA anyway. Excel errors, prefixed # in excel, will be read as comment markers and cause the remainder of the line to be ignored. This often causes this kind of error.

Steve E
>>> Monna Nygård <> 30/04/2008 11:51:16 >>>

No matter how I´ve tried o find a solution for this simple question, I can´t. Sorry for bothering with such a matter.  

I have an excel-files with some empty cells=missing values. How do I tell R that these should be NA´s?  

> TRFLP1 <-(read.table(file="S://SEDIM//Kokeilu//TRFLP1.txt",col.names= c("Dye_Sample Peak", "Sample_File_Name", "Size", "Height", "Area_in_Point", "Area_in_BP", "Data_Point", "Begin_Point", "Begin_BP", "End_Point", "End_BP", "Width_in_Point", "Width_in_BP", "1" ), header=F , dec = ",", )Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 1743 did not have 14 elements

I believe the error occurs becouse line 1743 has an empty cell. How do I read in the file without first checking for missing values and changing them to NAs myself?  

Thank you for you time,  

Monna Nygård

        [[alternative HTML version deleted]]

This email and any attachments are confidential. Any use...{{dropped:8}} mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 30 Apr 2008 - 11:36:13 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 Wed 30 Apr 2008 - 12:30:33 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive