diff --git a/R/util.r b/R/util.r index ef75489..dcd6e5e 100644 --- a/R/util.r +++ b/R/util.r @@ -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: ",