There is a small typo in the NEWS file: write.table -> write.ftable -----Message d'origine----- De : SOEIRO Thomas Envoyé : jeudi 2 septembre 2021 13:10 À : 'Martin Maechler' Cc : r-devel@r-project.org Objet : RE: [Rd] sep hard coded in write.ftable
Dear Martin, Thank you very much for your prompt feedback! Best regards, Thomas -----Message d'origine----- De : Martin Maechler [mailto:maech...@stat.math.ethz.ch] Envoyé : jeudi 2 septembre 2021 11:30 À : SOEIRO Thomas Cc : r-devel@r-project.org Objet : Re: [Rd] sep hard coded in write.ftable EMAIL EXTERNE - TRAITER AVEC PRÉCAUTION LIENS ET FICHIERS >>>>> SOEIRO Thomas >>>>> on Wed, 1 Sep 2021 15:01:43 +0000 writes: > Dear all, > (This is a follow up of a previous suggestion for ftable that was added in R 4.1.0: https://urldefense.com/v3/__https://stat.ethz.ch/pipermail/r-devel/2020-May/079451.html__;!!JQ5agg!KmMY870t4h88LdWZEtwjGSopF57R5zxrL05DHa6nECGqI5_nFYUsC3OJoOzD0LQYZLOR$ ) > The sep argument is hard coded in write.ftable: > write.ftable <- function(x, file = "", quote = TRUE, append = FALSE, > digits = getOption("digits"), ...) > { > r <- format.ftable(x, quote = quote, digits = digits, ...) > cat(t(r), file = file, append = append, > sep = c(rep(" ", ncol(r) - 1), "\n")) > invisible(x) > } > A minor change would allow users to modify it: > write.ftable2 <- function(x, file = "", quote = TRUE, append = FALSE, > digits = getOption("digits"), sep = " ", ...) > { > r <- stats:::format.ftable(x, quote = quote, digits = digits, ...) > cat(t(r), file = file, append = append, > sep = c(rep(sep, ncol(r) - 1), "\n")) > invisible(x) > } I agree this sounds reasonable, and am currently running 'make check-devel' on sources modified accordingly .. Martin > This would allow to avoid a previous call to format.ftable (although write.ftable is significantly slower than write.table): > ftable(formula = wool + tension ~ breaks, data = warpbreaks) |> > format(quote = FALSE) |> > write.table(sep = ";", row.names = FALSE, col.names = FALSE) > ftable(formula = wool + tension ~ breaks, data = warpbreaks) |> > write.ftable2(sep = ";") > Best regards, > Thomas > ______________________________________________ > R-devel@r-project.org mailing list > https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/r-devel__;!!JQ5agg!KmMY870t4h88LdWZEtwjGSopF57R5zxrL05DHa6nECGqI5_nFYUsC3OJoOzD0M93CBRa$ ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel