Skip to contents

Makes a copy of a function with new defaults. Similar to purrr::partial except that arguments with new defaults still accept input.

Usage

redefault(.f, ...)

Arguments

.f

function

...

<dynamic-dots> new defaults

Value

function

Examples

squircle <- redefault(ob_ellipse, m1 = 4)
squircle(a = 3)
#> <ob_ellipse>
#> @ center: <ob_point>
#>  @ x: num 0
#>  @ y: num 0
#> @ a     : num 3
#> @ b     : num 3
#> @ angle : <radian>
#>  @ radian: num 0
#> @ m1    : num 4
#> @ m2    : num 4
#> Other props: label, alpha, color, fill, linewidth, linetype,
#>              n, area, bounding_box, focus_1, focus_2, length,
#>              perimeter, style, tibble, angle_at, geom, normal_at,
#>              point_at, tangent_at, aesthetics