Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using formals to assign new defaults to function #20

Open
ChristophLeonhardt opened this issue Apr 19, 2023 · 0 comments
Open

Using formals to assign new defaults to function #20

ChristophLeonhardt opened this issue Apr 19, 2023 · 0 comments
Assignees

Comments

@ChristophLeonhardt
Copy link
Collaborator

To facilitate fuzzy matching, currently a list of functions is passed to fuzzyjoin::fuzzy_join(). To make these functions customizable, one way I found was to use formals to change the defaults of the arguments.

LinkTools/R/LTDataset.R

Lines 815 to 819 in 60543c9

stringdist_join_match_fun_for_list <- self$stringdist_join_match_fun
formals(stringdist_join_match_fun_for_list)[["ignore_case"]] <- ignore_case
formals(stringdist_join_match_fun_for_list)[["method"]] <- dist_method
formals(stringdist_join_match_fun_for_list)[["max_dist"]] <- max_dist

Is there a more direct way to access the arguments of the function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants