Hi Jan,

The issue isn't that the ... arguments aren't passed on.  Rather, the
problem is that in the current implementation the ... arguments are passed
to format(), which doesn't understand the "eol" argument.

The solution is to modify write.fwf() to explicitly accept all of the
appropriate the arguments for write.table() and to only pass the ...
arguments to format() and format.info().

I've just modified gdata to make this change, and have submitted the new
version to CRAN as gdata version 2.8.1.

-Greg

On Fri, Nov 12, 2010 at 7:08 AM, Jan Wijffels <janwijffels@hotmail.com>wrote:

>
> Dear R-list
>
> This is just message to inform that the there is an issue with write.fwf in
> the gdata library (from version 2.5.0 on). It does not seem to accept
> further arguments to write.table like "eol" as the help file indicates as it
> stops when executing tmp <- lapply(x, format.info, ...).
> Great package though - I use it a lot except for this function :)
> See example below.
>
> > require(gdata)
> > saveto <- tempfile(pattern = "test.txt", tmpdir = tempdir())
> > write.fwf(x = data.frame(a=1:length(LETTERS), b=LETTERS), file=saveto,
> eol="\r\n")
> Error in FUN(X[[1L]], ...) : unused argument(s) (eol = "\r\n")
> > sessionInfo()
> R version 2.12.0 (2010-10-15)
> Platform: x86_64-pc-linux-gnu (64-bit)
>
> locale:
>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8
>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] gdata_2.8.0
>
> loaded via a namespace (and not attached):
> [1] gtools_2.6.2
>
>
> kind regards,
> Jan
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@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.
>

	[[alternative HTML version deleted]]

