Module: ClassDataUtilities

Included in:
Classification, CtTile, Density, Histogram, ImTile, Original, StatResults, Statistic, Test
Defined in:
lib/analyzer.rb

Instance Method Summary collapse

Instance Method Details

#export(file_path) ⇒ Object



585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
# File 'lib/analyzer.rb', line 585

def export file_path
  CSV.open(file_path, "wb") do |csv|
    headers=self.keys.keys.sort
    puts headers
    csv << headers
    self.all.each do |c|
      line=[]
      headers.each do |h|
        line<<(c[h]).to_s
      end
      csv << line
    end
    puts csv
  end
end