diff --git a/R/defaults.R b/R/defaults.R index 45d2732dff..11c5f9b4b9 100644 --- a/R/defaults.R +++ b/R/defaults.R @@ -22,7 +22,10 @@ new_defaults = function(value = list()) { set2 = function(values) { old = get(names(values), drop = FALSE) if (length(values)) { - if (locked) stop('The object is read-only and cannot be modified.') + if (locked) stop( + 'The object is read-only and cannot be modified. If you have to modify it ', + 'for a legitimate reason, call the method $lock(FALSE) on the object before $set().' + ) defaults <<- merge(values) } invisible(old)