Hi list, Is there a way to read in a txt file with some blanks? The ideal way could be to replace blanks with NAs. Thanks a lot! Allen [[alternative HTML version deleted]]
If the data is fixed field, then read.fwf. Else blanks are normally allowed delimiters. How do you want to interprete blanks? There are number of ways, none of which you have specified. On Nov 28, 2007 6:46 PM, affy snp <affysnp at gmail.com> wrote:> Hi list, > Is there a way to read in a txt file with some blanks? The ideal way could > be to replace blanks with NAs. > > Thanks a lot! > > Allen > > [[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. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve?
On Wed, 28-Nov-2007 at 06:46PM -0500, affy snp wrote: |> Hi list, |> Is there a way to read in a txt file with some blanks? The ideal way could |> be to replace blanks with NAs. If the fields are delimited by tabs, the blanks will automatically become NAs if you use read.table but without any more details, nobody can tell if that's all you need to do. -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___ Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_ Middle minds discuss events (:_~*~_:) Small minds discuss people (_)-(_) ..... Anon ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.