[R] Hmisc summary.formula.reverse export problem

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Mar 30 09:47:24 CEST 2007


Well, write.table works on 'tables', that is matrix-like objects.
An object summary is not matrix-like.

You may be looking for

capture.output(print(taulu3), file="O:/taulu1.txt")


On Fri, 30 Mar 2007, Lauri Nikkinen wrote:

> Dear R-users,
>
> I'm trying to export object taulu3 from R to a text file (separated with
> semicolon). Object taulu3 is made with summary.formula in Hmisc package:
>
> taulu3 <- summary(sp ~ pdg_newtext, data=tr_ekahj, method="reverse",
> overall=TRUE)
> class(taulu3)
> [1] "summary.formula.reverse"
>
> When I try to export the object taulu3, I get the following error message:
>
> write.table(taulu3, "O:/taulu1.txt", sep=";")
>
> Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors =
> stringsAsFactors) :
>        cannot coerce class "summary.formula.reverse" into a data.frame
>
> How can I get this object exported properly? I'm using Windows XP and I
> don't know latex yet.
>
> Regards,
> Lauri
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list