[R] End of line marker?

David Winsemius dwinsemius at comcast.net
Thu Mar 4 14:29:48 CET 2010


On Mar 3, 2010, at 2:22 PM, jonas garcia wrote:

> Dear R users,
>
> I am trying to read a huge file in R. For some reason, only a part  
> of the
> file is read. When I further investigated, I found that in one of my
> non-numeric columns, there is one odd character responsible for  
> this, which
> I reproduce bellow:
> 
> In case you cannot see it, it looks like a right arrow, but it is  
> not the
> one you get from microsoft word in menu "insert symbol".
>
> I think my dat file is broken and that funny character is an EOL  
> marker that
> makes R not read the rest of the file. I am sure the character is  
> there by
> chance but I fear that it might be present in some other big files I  
> have to
> work with as well. So, is there any clever way to remove this  
> inconvenient
> character in R avoiding having to edit the file in notepad and  
> remove it
> manually?
>
> Code I am using:
>
> read.csv("new3.dat", header=F)
>
> Warning message:
> In read.table(file = file, header = header, sep = sep, quote =  
> quote,  :
>  incomplete final line found by readTableHeader on 'new3.dat'

I think you should identify the offending line by using the  
count.fields function and fix it with an editor.


-- 
David
>
> I am working with R 2.10.1 in windows XP.
>
> Thanks in advance
>
> Jonas
>
> 	[[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.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT



More information about the R-help mailing list