Skip to content

Commit

Permalink
Fixed a bug when only one numeric column was requested
Browse files Browse the repository at this point in the history
  • Loading branch information
frankcorneliusmartin committed Feb 1, 2024
1 parent c4b51f4 commit f80f9a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vtg.summary/src/R/RPC_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f80f9a5

Please sign in to comment.