in reply to Re: summary statistics using Data::Table
in thread summary statistics using Data::Table
Thanks a lot charob! i like DRY :-)
here are suggestion i got which use the colnames:
Version1:
my @mean123=map( ($t->elm($_,'value1')+$t->elm($_,'value2')+$t->elm($_ +,'value3'))/3.0, 0..$t->nofRow()-1); $t->addCol(\@mean123, 'Mean123'); print $t->csv;
Version2:
all works super fine- thanks a lot for your help!$t->addCol(undef, 'Mean45'); # add a new column for (my $i=0; $i< $t->nofRow; $i++) { $r=$t->rowHashRef($i); $t->setElm($i, 'Mean45', ($r->{'value4'}+$r->{'value5'})/2.0); } print $t->csv;
|
|---|