[R] Error while trying to save summary() output as csv

Ista Zahn istazahn at gmail.com
Mon Mar 22 20:06:42 CET 2010


Hi Kamil,
You can use something like
write.csv(t(as.matrix(object)), file="name.csv")

-Ista
On Mon, Mar 22, 2010 at 2:54 PM, Kamil Sijko <Kamil.Sijko at swps.edu.pl> wrote:
> Hi,
>
> I need to save output of summary() procedure to a csv file. It's all
> OK when it's applied to a 'factor' class variable, but when I try to
> save a 'integer' class summary to csv it gives me :
>
>> summary(rnorm(100, 10)) -> object
>> write.csv2(object, file='name.csv')
> Error in do.call("expand.grid", c(dimnames(x), stringsAsFactors =
> stringsAsFactors)) :
>  second argument must be a list
>
> It's the same when I use write.csv instead of write.csv2
>
> summary() produces a very simple table:
>
> structure(c(7.803, 9.633, 10.15, 10.17, 10.75, 12.41), .Names = c("Min.",
> "1st Qu.", "Median", "Mean", "3rd Qu.", "Max."), class = "table")
>
> I have no idea, what to do... So Group, please help me: what does this
> error mean, and how to cope with it?
>
> Thanks for your help.
> Kamil
>
> ______________________________________________
> R-help at 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.
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org



More information about the R-help mailing list