From f80f9a5f3dfd43be5bed08d1b31370b6b77a432b Mon Sep 17 00:00:00 2001 From: Frank Martin Date: Thu, 1 Feb 2024 16:52:33 +0100 Subject: [PATCH] Fixed a bug when only one numeric column was requested --- vtg.summary/src/R/RPC_summary.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vtg.summary/src/R/RPC_summary.R b/vtg.summary/src/R/RPC_summary.R index 63893a6..34345af 100644 --- a/vtg.summary/src/R/RPC_summary.R +++ b/vtg.summary/src/R/RPC_summary.R @@ -123,7 +123,11 @@ get_column_ranges <- function(data, columns) { # numeric summary summary_numeric <- NULL if (length(numeric_columns) > 0) { - summary_numeric <- do.call(cbind, lapply(data[, numeric_columns], summary)) + if (length(numeric_columns) == 1) { + summary_numeric <- cbind(numeric_columns=summary(data[, numeric_columns])) + colnames(summary_numeric) <- numeric_columns + } else { + summary_numeric <- do.call(cbind, lapply(data[, numeric_columns], summary)) } # factorial summary - omit NAs to not make that a separate category