Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

Re: [R] read.fwf and header

Martin Maechler

2006-11-04

Replies:


>>>>> "FrPi" == François Pinard <pinard@(protected)>
>>>>>   on Wed, 1 Nov 2006 20:21:11 -0500 writes:

  FrPi> [Martin Maechler]
  >> In my (and probably R-core's) view, read.fwf() should only have
  >> to be used for ``legacy data files'' (those times when people used *no*
  >> separators in order to save disk space), since nowadays, such
  >> data files should "automatically" have correct separators.

  FrPi> In my day-to-day experience, the main virtue for fixed width format
  FrPi> files is basic, humble legibility, much more than disk space savings.
Good point. For this reason, I often prefer <tab>-delimited data files
which are human readable too (and don't need quoting of strings,
typically). But also, the read.table() default <white space>-separated files
are very well humanly readable if the column starts are
aligned. You do need to quote ("..") strings with embedded white
space then, but that is very well
human-readable if you have a smart editor (such as Emacs ;-)
which then automatically colorizes strings differently than the
rest of the file entries.

However, I think this (human-readibility) only
applies to relatively small files.


  FrPi> The FWF files I see have delimiters between fields,
  FrPi> but also embedded space within fields, or at end of
  FrPi> fields, without extraneous quotes. XML markup, CSVs,
  FrPi> quoted fields, etc. are devices meant for helping
  FrPi> machines much more than for helping humans. They
  FrPi> significantly decrease legibility. Humans not only
  FrPi> know better, they decipher fixed width format easily
  FrPi> enough for not really needing hairier devices in
  FrPi> general.

  FrPi> FWF files may be archaic, they are not obsolescent.
  FrPi> They will resist the fashion of the day for
  FrPi> complexity, and survive in the long run.

I cannot really oppose this statement,
but am not as sure as you seem ;-)

Thanks anyway for the thought provoking reply.
With regards,
Martin

______________________________________________
R-help@(protected)
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.
©2008 r-help.com - Jax Systems, LLC, U.S.A.