-
Notifications
You must be signed in to change notification settings - Fork 35
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
Standard evaluation version of functions #67
Comments
Sounds like a good idea. How would that api look exactly? Pass in a lazyeval object or a character string? |
I think you want something like this: setGeneric("set_objective", function(model, expression, direction = "max") {
set_objective_(model, expression = lazyeval::lazy(expression), direction = direction)
}
setGeneric("set_objective_", function(model, expression, direction = "max") {
# As the current set_objective fn, but without calls to substitute
}
BTW, if function(model, expression, direction = c("max", "min")) then calling |
Cool thanks. Will look into this. Indeed, maybe I should use lazyeval instead of base R's eval/substitute constructs. |
@richierocks Added a first version. If you have any comments on the code or other ideas let me know |
|
Still needs a solution for variable and constraint quantifiers |
Standard evaluation is often better for when you want to include code in your own packages. Do you plan to include standard evaluation versions of the functions?
I'm thinking of the dplyr style, for example
filter
vs.filter_
. So you could includeadd_variable_
,set_obejctive_
, etc.I think that most of the logic is handled by the lazyeval package, so it shouldn't be too tricky to implement.
The text was updated successfully, but these errors were encountered: