diff charts.r @ 59:5164a18d0916 draft

Uploaded
author guerler
date Tue, 17 Jun 2014 07:52:40 -0400
parents f294f5c9608c
children 8aa930289c8b
line wrap: on
line diff
--- a/charts.r	Mon Jun 16 10:58:10 2014 -0400
+++ b/charts.r	Tue Jun 17 07:52:40 2014 -0400
@@ -94,8 +94,15 @@
     writeLines(header_columns, output)
     writeLines('#', output)
     
+    # pad columns
+    rows <- max(unlist(lapply(l, length)))
+    padded <- lapply(l, function(col) {
+        length(col) = rows;
+        col
+    })
+    
     # write table
-    write.table(l, file=output, row.names=FALSE, col.names = FALSE, quote=FALSE, sep='\t')
+    write.table(padded, file=output, row.names=FALSE, col.names = FALSE, quote=FALSE, sep='\t')
     
     # close file
     close(output)