# HG changeset patch # User guerler # Date 1396913059 14400 # Node ID 39ee947b4a9ee1765c5639cee2ae723b8f9eefb8 # Parent e915224afc1d01dcc30610d072eb6716052ee55b Uploaded diff -r e915224afc1d -r 39ee947b4a9e histogram.r --- a/histogram.r Mon Apr 07 19:24:08 2014 -0400 +++ b/histogram.r Mon Apr 07 19:24:19 2014 -0400 @@ -10,12 +10,19 @@ column_data <- sapply( table[column], as.numeric ) # create hist data - hist_data <- hist(column_data, plot=FALSE)#, breaks=seq(by=options$bin_size)) + hist_data <- hist(column_data, plot=FALSE) # collect vectors in list l <- append(l, list(hist_data$breaks[2: length(hist_data$breaks)])) l <- append(l, list(hist_data$density)) } + + # make sure length is fine + n <- max(sapply(l, length)) + ll <- lapply(l, function(X) { + c(as.character(X), rep("", times = n - length(X))) + }) + l <- do.call(cbind, ll) # return return (l)