update_function_params | R Documentation |
Update function default parameters
update_function_params(
function_name = NULL,
param_name = NULL,
new_values = NULL,
verbose = FALSE,
...
)
function_name |
|
param_name |
|
new_values |
|
verbose |
|
... |
additional arguments are ignored. |
This function is a minor extension to update_list_elements()
intended to help update function parameters which are defined
as a nested list. See examples.
The main utility is for a function that defines a full set of required argument values, where the user calling the function may want to modify onyl a subset of those default values.
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_list_elements()
# function uses y as passed to the function
test_function_1 <- function(y=list(a=1, b=4)) {
print("y:");
print(y);
}
test_function_1(y=list(b=5, d=1:5))
# function starts with y formals, adds or updates new values
test_function_2 <- function(y=list(a=1, b=4)) {
y <- update_function_params(test_function_1,
param_name="y",
new_values=y);
print("y:");
print(y);
}
test_function_2(y=list(b=5:6, d=1:5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.