# HG changeset patch # User greg # Date 1515684918 18000 # Node ID fb23828b634bc2f117d3152fecbd90320d7fe759 # Parent f73d71daefd5da820ecf60cdb3ff7c26ecf2923a Uploaded diff -r f73d71daefd5 -r fb23828b634b create_heatmap.R --- a/create_heatmap.R Wed Jan 10 14:27:44 2018 -0500 +++ b/create_heatmap.R Thu Jan 11 10:35:18 2018 -0500 @@ -37,6 +37,10 @@ create_heatmap <- function(data_frame, output_file_name, colors=c("white", "dark blue")) { # Plot a heatmap for a .para / .state combination based on the # received data_frame which was created by reading the .para file. + num_columns = dim(data_frame)[2]; + num_rows = dim(data_frame)[1]; + p = (sqrt(9 + 8 * (num_columns-1)) - 3) / 2; + data_matrix = as.matrix(data_frame[,1+1:p] / data_frame[,1]); state_colors_vector = get_state_color_codes_vector(data_frame, colors=colors, color_code_type="hex"); # Open the output PDF file. pdf(file=output_file_name);