How to encourage drive-by commits? #361
-
Thanks for the super nice suite of packages. Very powerful and flexible, and the model coverage is simply outstanding! I also looove the lack of dependencies. Awesome work! This morning, I tried to put together a PR to support I'm now opening this Issue to start a brainstorm about ways to make drive-by commits easier. The intent is not to criticize the package design, but simply a recognition that developper burnout is endemic in open source software development, and that there is often a trade-off between optimizing for code re-use and optimizing for ease of contributions. Here are some of the (mental) steps I went through:
At this point, I have modified 5 files across two repositories, poured over And I still haven't figured out how to get In contrast, I copy a MWE I understand that there are benefits to a more complex design, because it gives you lots of stuff "for free". But I still think this example illustrates how hard it can be for newbies to contribute to a project where methods are split over so many repos and files, and that requires layers of extractor functions. Again, this is not meant as a criticism of your design. The packages are awesome and super impressive! My question is whether there are ways we could make it easier for newbies like me to help out. library(lmtest)
library(generics)
mod <- coeftest(lm(hp ~ mpg, mtcars))
tidy.coeftest <- function(x, conf.int=FALSE, conf.level=.95, ...) {
out <- data.frame(
term = row.names(x),
estimate = x[, 1],
std.error = x[, 2],
statistic = x[, 3],
p.value = x[, 4])
if (isTRUE(conf.int)) {
tmp <- confint(x, level=.95)
out$conf.low <- out[, 2]
out$conf.high <- out[, 3]
}
row.names(out) <- NULL
out
}
glance.coeftest <- function(x, ...) {
out <- data.frame(
nobs = nobs(x),
logLik = logLik(x)
)
out
} |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 21 replies
-
(Thanks a ton for opening this *passes the mic to @strengejacke and fades away* |
Beta Was this translation helpful? Give feedback.
-
I think one disadvantage in our API design is that we 1) had not in mind how packages are evolving and how much functions / packages we now actually have; 2) thereby, we did not initially plan "classic" OOP style where it is possible for other developers to easily develop own methods, or in particular to contribute to our packages. When we planned our packages, we had several ideas in mind and several things to consider:
However, there are also some advantages when going this way. For instance, if you want standardized estimates, or robust vcov-estimation for robust standard errors etc., you don't have to add much stuff to make it work. There is one central function for computing robust vcov's, and Hence, once these functions are available: In insight
in parameters
... all these "extras" like standardizing or robust SE work. In total, yes, these are 9 functions to add. In theory, there could be none to add, if all models would have consistent methods / design. So somewhere in between is the effort of adding new models. However, if all these methods exist, functions like Hence, there are pros and cons regarding our approach, and it's difficult to find the best way for the API design, especially since we made some decisions in the past, where we could not foresee where our ecosystem is going... |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the useful and detailed answer. I understand that your design allows you to get a lot of free stuff. That's a testament to how well you have designed the functions built on top of I think the main barrier to entry for me stemmed from a combination of (a) the decision to use separate methods instead of Given that most The most difficult part, for me, was the decision to split all those methods across different files and packages. If all the In any case, I realize that this is just me raising minor critiques about a fantastically useful project that volunteers have sunk hundreds of hours into. Mostly, I'm just really appreciative of all the work you've put in this. Awesome stuff! |
Beta Was this translation helpful? Give feedback.
-
Quick question: Does this need to be exported explicitly, or will the default just kick in automatically? p_value.lm <- p_value.default |
Beta Was this translation helpful? Give feedback.
I think one disadvantage in our API design is that we 1) had not in mind how packages are evolving and how much functions / packages we now actually have; 2) thereby, we did not initially plan "classic" OOP style where it is possible for other developers to easily develop own methods, or in particular to contribute to our packages.
When we planned our packages, we had several ideas in mind and several things to consider:
find_predictors()
andget_predictors()
.