From c92b1c108e3bf510a6ddb11c66f20b62e2c587a5 Mon Sep 17 00:00:00 2001 From: brgew Date: Fri, 9 Feb 2024 09:40:09 -0800 Subject: [PATCH] Add extract_coefficient_helper() fix for when model formula is ~1. --- R/expr_models.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/expr_models.R b/R/expr_models.R index 53788ad7..93aa5855 100644 --- a/R/expr_models.R +++ b/R/expr_models.R @@ -432,6 +432,9 @@ extract_coefficient_helper = function(model, model_summary, # We need this because some summary methods "format" the coefficients into # a factor... coef_mat <- apply(coef_mat, 2, function(x) {as.numeric(as.character(x)) }) + if (!is.matrix(coef_mat)) { + coef_mat = t(as.matrix(coef_mat)) + } row.names(coef_mat) = row.names(model_summary$coefficients) colnames(coef_mat) = c('estimate', 'std_err',