@@ -164,7 +164,7 @@ formula_ok <- function(x,
164
164
# ' @rdname find_formula
165
165
# ' @export
166
166
find_formula.default <- function (x , verbose = TRUE , ... ) {
167
- f <- .safe(list (conditional = .dot_formula(stats :: formula(x ), x )))
167
+ f <- .safe(list (conditional = .dot_formula(stats :: formula(x ), x , ... )))
168
168
.find_formula_return(f , verbose = verbose )
169
169
}
170
170
@@ -1141,7 +1141,7 @@ find_formula.tobit <- function(x, verbose = TRUE, ...) {
1141
1141
1142
1142
# ' @export
1143
1143
find_formula.hurdle <- function (x , verbose = TRUE , ... ) {
1144
- .zeroinf_formula(x , verbose = verbose )
1144
+ .zeroinf_formula(x , verbose = verbose , ... )
1145
1145
}
1146
1146
1147
1147
# ' @export
@@ -1153,7 +1153,7 @@ find_formula.zerotrunc <- find_formula.hurdle
1153
1153
1154
1154
# ' @export
1155
1155
find_formula.zcpglm <- function (x , verbose = TRUE , ... ) {
1156
- .zeroinf_formula(x , separator = " \\ |\\ |" , verbose = verbose )
1156
+ .zeroinf_formula(x , separator = " \\ |\\ |" , verbose = verbose , ... )
1157
1157
}
1158
1158
1159
1159
@@ -1742,7 +1742,7 @@ find_formula.model_fit <- function(x, verbose = TRUE, ...) {
1742
1742
1743
1743
# Find formula for zero-inflated regressions, where
1744
1744
# zero-inflated part is separated by | from count part
1745
- .zeroinf_formula <- function (x , separator = " \\ |" , verbose = TRUE ) {
1745
+ .zeroinf_formula <- function (x , separator = " \\ |" , verbose = TRUE , ... ) {
1746
1746
f <- tryCatch(stats :: formula(x ), error = function (x ) NULL )
1747
1747
1748
1748
if (is.null(f )) {
@@ -1761,7 +1761,7 @@ find_formula.model_fit <- function(x, verbose = TRUE, ...) {
1761
1761
# # TODO could be extended to all find_formula()
1762
1762
1763
1763
# fix dot-formulas
1764
- c.form <- .dot_formula(f = c.form , model = x )
1764
+ c.form <- .dot_formula(f = c.form , model = x , ... )
1765
1765
1766
1766
# fix dot-formulas
1767
1767
zi.form <- tryCatch(
@@ -1786,7 +1786,13 @@ find_formula.model_fit <- function(x, verbose = TRUE, ...) {
1786
1786
1787
1787
# try to guess "full" formula for dot-abbreviation, e.g.
1788
1788
# lm(mpg ~., data = mtcars)
1789
- .dot_formula <- function (f , model ) {
1789
+ .dot_formula <- function (f , model , ... ) {
1790
+ # skip_dot_formula = TRUE is only internally used, to avoid infinite loops
1791
+ # when `find_formula()` is called from `get_data()`
1792
+ if (isTRUE(list (... )$ skip_dot_formula )) {
1793
+ return (f )
1794
+ }
1795
+
1790
1796
# fix dot-formulas
1791
1797
tryCatch(
1792
1798
{
0 commit comments