From Emmanuel.Paradis at mpl.ird.fr  Thu Oct 20 10:40:49 2005
From: Emmanuel.Paradis at mpl.ird.fr (Emmanuel.Paradis@mpl.ird.fr)
Date: Thu, 20 Oct 2005 10:40:49 +0200 (CEST)
Subject: [Rd] read.fwf doesn't work with header = TRUE (PR#8226)
Message-ID: <20051020084049.2E29D8684@slim.kubism.ku.dk>

Full_Name: Emmanuel Paradis
Version: 2.1.1
OS: Linux
Submission from: (NULL) (193.49.41.105)


read.fwf(..., header = TRUE) does not work properly since:

1/ the original header is printed on the console and not in FILE;
2/ the different 'parts' of the header should be separated with tabs
   to work with the call to read.table.

Here is a suggested fix for src/library/utils/R/read.fwf.R:

38c38,40
<         cat(FILE, headerline, "\n")
---
>         headerline <- unlist(strsplit(headerline, " {1,}"))
>         headerline <- paste(headerline, collapse = "\t")
>         cat(file = FILE, headerline, "\n")

PS: my R is not updated by read.fwf.R does not seem to have been changed in R
2.2.0.



[Rd] read.fwf doesn't work with header = TRUE (PR#8226)
Emmanuel.Paradis@mpl.ird.fr