I gave a little thought to the fit()
interface problem and this is what I came up with. I don't really like the interface
arg name but thats just a naming thing.
# helper if required xy <- function(x, y) { list(x = x, y = y) } # notice how engine would come before the _optional_ data param for pipeability # all required params are now moved to the front # engine could come before interface if you want to keep interface+data together fit <- function(model_spec, interface, engine, data, control, ...) { #switch based on interface being a formula VS list } linear_reg() %>% fit(y ~ x1 + x2, "lm", fit_data) linear_reg() %>% fit(xy(fit_data[,c("x1", "x2")], fit_data[,c("y")]), "lm") # slightly simpler xy_defn <- xy( x = fit_data[,c("x1", "x2")], y = fit_data[,c("y")] ) linear_reg() %>% fit(xy_defn, "lm")
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4