Method: Bio::ContingencyTable#column_sum

Defined in:
lib/bio/util/contingency_table.rb

#column_sum(j) ⇒ Object

Report the sum of all values in a given column


Arguments

  • j: Column to sum

Returns

Integer sum of column



280
281
282
283
284
# File 'lib/bio/util/contingency_table.rb', line 280

def column_sum(j)
  total = 0
  @table.each { |row_key, column| total += column[j] }
  total
end