Skip to content
Prev 11775 / 398502 Next

read.table and missing values

I'd like to share data files (tab delimited text files)
that i read in via read.table with other applications.
Missing data are empty fields (two tabs following each other)
I couldn't find a way yet to 'convince' R to interprete this to be 
missing values.
The read.table option na.strings="" or na.strings='' didn't work.
using any special character in the data file for missings (like '#') 
and defining it for missing using na.strings="#" worked.
So I was able to solve the problem doing a global replace.
But I'd prefer to read in the data files as is and wonder whether 
there is a possibility to that in R.
Data Import/Export Manual says that empty fields in numeric columns 
are regarded as missing values.
But with my versions of R (Windows 1.2.3, Mac) it didn't work
Documention, FAQ and the mailing archive didn't have any further hint.
Thanks for any advice

Peter