From 79683968b64bc81f355862328eb717925a98fb97 Mon Sep 17 00:00:00 2001 From: Adam Sadowski <40274818+asadow@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:46:20 -0400 Subject: [PATCH] Improve `list_modify()` examples (#1117) --- R/list-modify.R | 5 +++-- man/list_assign.Rd | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/R/list-modify.R b/R/list-modify.R index 8d3e823b..e7097c40 100644 --- a/R/list-modify.R +++ b/R/list-modify.R @@ -25,12 +25,13 @@ #' #' # Update values #' str(list_assign(x, a = 1)) +#' #' # Replace values #' str(list_assign(x, z = 5)) #' str(list_assign(x, z = NULL)) -#' #' str(list_assign(x, z = list(a = 1:5))) -#' # replace recursively, leaving the other elements of z alone +#' +#' # Replace recursively with list_modify(), leaving the other elements of z alone #' str(list_modify(x, z = list(a = 1:5))) #' #' # Remove values diff --git a/man/list_assign.Rd b/man/list_assign.Rd index 5e0d3a95..20676e6e 100644 --- a/man/list_assign.Rd +++ b/man/list_assign.Rd @@ -47,12 +47,13 @@ str(x) # Update values str(list_assign(x, a = 1)) + # Replace values str(list_assign(x, z = 5)) str(list_assign(x, z = NULL)) - str(list_assign(x, z = list(a = 1:5))) -# replace recursively, leaving the other elements of z alone + +# Replace recursively with list_modify(), leaving the other elements of z alone str(list_modify(x, z = list(a = 1:5))) # Remove values