In R, How to add Row for Information:

Posted by Moe on Stack Overflow See other posts from Stack Overflow or by Moe
Published on 2010-04-20T13:40:21Z Indexed on 2010/04/20 13:43 UTC
Read the original article Hit count: 156

Filed under:
|
|

Hi,

I'm trying to add a Row to my data.frame to spit out the average of the column.

This is my data frame:

              Weight Response
1   Control     59      0.0
2 Treatment     90      0.8
3 Treatment     47      0.1
4 Treamment    106      0.1
5   Control     85      0.7
6 Treatment     73      0.6
7   Control     61      0.2

I'd like it to become:

              Weight Response
1   Control     59      0.0
2 Treatment     90      0.8
3 Treatment     47      0.1
4 Treamment    106      0.1
5   Control     85      0.7
6 Treatment     73      0.6
7   Control     61      0.2
8 AVERAGES      74      0.3

Thanks!

© Stack Overflow or respective owner

Related posts about r

    Related posts about statistics