将摘要(aov.sample)导出为R中的CSV

时间:2013-07-09 21:50:27

标签: r csv output

警告:包含自学成才的R newbie。

Summary(aov.sample)创建一个ANOVA结果表,以便

Error: particip
      Df Sum Sq Mean Sq F value Pr(>F)
Residuals 11  16.49   1.499               

Error: particip:device
          Df Sum Sq Mean Sq F value Pr(>F)  
device     1  14.22  14.222    3.76 0.0786 .
Residuals 11  41.61   3.783                 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Error: particip:width
          Df Sum Sq Mean Sq F value   Pr(>F)    
width      1 177.35  177.35   63.64 6.71e-06 ***
Residuals 11  30.65    2.79                     
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Error: particip:length
          Df Sum Sq Mean Sq F value   Pr(>F)    
length     1 183.68  183.68   115.5 3.57e-07 ***
Residuals 11  17.49    1.59                     
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Error: particip:device:width
             Df Sum Sq Mean Sq F value Pr(>F)
device:width  1   0.50   0.500    0.14  0.715
Residuals    11  39.17   3.561               

Error: particip:device:length
              Df Sum Sq Mean Sq F value Pr(>F)
device:length  1  1.389   1.389   0.661  0.433
Residuals     11 23.111   2.101               

Error: particip:width:length
             Df Sum Sq Mean Sq F value   Pr(>F)    
width:length  1 276.13  276.13   120.5 2.89e-07 ***
Residuals    11  25.21    2.29                     
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Error: particip:device:width:length
                    Df Sum Sq Mean Sq F value Pr(>F)
device:width:length  1  2.722   2.722   1.085   0.32
Residuals           11 27.611   2.510               

Error: Within
                           Df Sum Sq Mean Sq F value Pr(>F)
group                       2    7.1   3.566   1.327  0.268
group:device                2    0.6   0.316   0.118  0.889
group:width                 2    0.1   0.045   0.017  0.983
group:length                2    6.0   3.024   1.125  0.327
group:device:width          2    1.6   0.823   0.306  0.737
group:device:length         2    1.7   0.858   0.319  0.727
group:width:length          2    3.1   1.531   0.570  0.567
group:device:width:length   2    8.0   4.003   1.490  0.228
Residuals                 176  473.0   2.688

其中typeof() = listclass() = summary.aovlist。我正在尝试使用delim.table来帮助我以CSV友好且可读的格式输出此表,但我得到的错误是cannot coerce class ""summary.aovlist"" to a data.frame,尽管delim.table文档说它将需要名单。我假设有一些关于aovlist子类的特殊问题,这是一个问题,但我不知道如何找出解决方法的内容或方法。我在这里做错了什么,如何以可读的方式将此表输出到CSV?

1 个答案:

答案 0 :(得分:-1)

有什么不对,没有规律性。这些不是真正的“表格”,而是文本和矩阵的模板。为了使这个逗号分开,你需要通过逗号来替换文本输出中的所有空格,结果我认为一团糟。此外,您要求使用尚未确定其来源的函数来完成此操作:

> ?delim.table
No documentation for ‘delim.table’ in specified packages and libraries:
you could try ‘??delim.table’

'aovlist'的一个实例可能只是......列表。您可以遍历列表并输出可作为常规对象输出的节点。但是为了告诉你如何在这种情况下做到这一点需要大量的猜测。

相关问题