R/jam-update-fn-params.R
update_list_elements.Rd
Update a subset of list elements (deprecated)
update_list_elements(
source_list,
update_list,
list_layer_num = 1,
verbose = FALSE,
...
)
list
with input values
list
with values to populate into source_list
.
integer
used for internal use by this function,
which defines the list depth when traversing a nested list.
logical
indicating whether to print verbose output.
additional arguments are ignored.
Deprecated.
This function is intended to help update a nested source_list
,
a subset of whose values should be replaced with entries
in update_list
, leaving any original entries in source_list
which were not defined in update_list
.
This function may be useful when manipulating lattice or ggplot2 graphical parameters, which are often stored in a nested list structure.
Note: This function is deprecated, because there exists a function
utils::modifyList()
written by Lattice co-author
Dr. Deepayan Sarkar, that serves the same purpose as this function.
No doubt the comment above is accurate, that this function is
widely used in the Lattice R package to update graphical
parameters.
Other jam utility functions:
blockArrowMargin()
,
find_colname()
,
fold_to_log2fold()
,
get_se_assaydata()
,
gradient_rect()
,
handle_highlightPoints()
,
log2fold_to_fold()
,
logAxis()
,
outer_legend()
,
points2polygonHull()
,
update_function_params()
# function starts with y formals, adds or updates new values
y <- list(a=1, b=4, e=NULL)
update_list_elements(y, list(b=5:6, d=1:5));
#> $a
#> [1] 1
#>
#> $b
#> [1] 5 6
#>
#> $e
#> NULL
#>
#> $d
#> [1] 1 2 3 4 5
#>
# also see the preferred function utils::modifyList below
utils::modifyList(y, list(b=5:6, d=1:5));
#> $a
#> [1] 1
#>
#> $b
#> [1] 5 6
#>
#> $e
#> NULL
#>
#> $d
#> [1] 1 2 3 4 5
#>