Skip to content

Commit

Permalink
fix empty list formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mschubert committed Nov 13, 2024
1 parent fbce8df commit 381b41a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/util.r
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ fill_template = function(template, values, required=c()) {

upd = keys %in% names(values)
is_num = sapply(values, is.numeric)
values[is_num] = format(values[is_num], scientific=FALSE, trim=TRUE)
if (length(is_num) > 0)
values[is_num] = format(values[is_num], scientific=FALSE, trim=TRUE)
vals[upd] = unlist(values)[keys[upd]]
if (any(is.na(vals)))
stop("Template values required but not provided: ",
Expand Down

0 comments on commit 381b41a

Please sign in to comment.