R/lmNULISAseq.R
safe_extract_matrix.RdExtracts a specific field (coefficients, t-values, or p-values) from a list of model statistics and combines them into a matrix with targets as rows and predictors as columns. Handles missing fields, NULL values, and targets with different sets of predictors by filling missing values with NA.
safe_extract_matrix(stats_list, field_name, all_predictors)A named list where each element contains model statistics for one target. Each element should be a list with fields like 'coefs', 't_vals', 'p_vals'
A character string specifying which field to extract (e.g., 'coefs', 't_vals', 'p_vals')
A character vector of all predictor names that should appear as columns in the output matrix
A numeric matrix with targets as rows and predictors as columns, with NA values where predictors are missing for specific targets