comparison histogram.r @ 2:001c5e3e5517 draft

Uploaded
author guerler
date Mon, 31 Mar 2014 17:22:25 -0400
parents
children 39ee947b4a9e
comparison
equal deleted inserted replaced
1:b4722f9d496f 2:001c5e3e5517
1 wrapper <- function(table, columns, options) {
2
3 # initialize output list
4 l <- list()
5
6 # loop through all columns
7 for (key in names(columns)) {
8 # load column data
9 column <- as.numeric(columns[key])
10 column_data <- sapply( table[column], as.numeric )
11
12 # create hist data
13 hist_data <- hist(column_data, plot=FALSE)#, breaks=seq(by=options$bin_size))
14
15 # collect vectors in list
16 l <- append(l, list(hist_data$breaks[2: length(hist_data$breaks)]))
17 l <- append(l, list(hist_data$density))
18 }
19
20 # return
21 return (l)
22 }