cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

Using rows to generate graphs

It would make scripts and analysis run faster if we could work with rows in similar fashion to columns. The current workaround is to stack or capture columns as a matrix, transpose, and put back into data table so row 1 becomes Col1. This take time and memory for large data tables.

If we could use a row of data (or matrix) in place of a column(:Col1) below to generate a graph, that would be very useful. In this example, I am creating graphs to save into a column using a loop for each row (not shown). I first had to capture the columns I want graphed into a matrix, transpose it and put it back into a new data table (dt_mat). Add a new column ("Read_Number") which is 1,2,3,4,5..... The original data was in columns: :read1, :read2, :read3, :read4, :read5,...... After transposition, it becomes :Col1, :Col2, :Col3, :Col4, :Col5, .... where the columns are same as untransposed rows from original table. The pic object is inserted into the table as part of loop. The actual code uses a list of column names in place of :Col1 below.

 

dist = dt_mat << Bivariate( Y( :Col1 ), X( :Read_Number ), Fit Each Value( {Line Color( {212, 73, 88} )} ) );
pic = (Report( dist )[Outline Box( "Bivariate Fit of Col1 By Read" )]) << getpicture;