Closed simonpcouch closed 2 months ago
Still trying to debug the following in devel win-builder:
Running examples in 'broom-Ex.R' failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: glance.anova
> ### Title: Glance at a(n) anova object
> ### Aliases: glance.anova
>
> ### ** Examples
>
> ## Don't show:
> if (rlang::is_installed("car")) (if (getRversion() >= "3.4") withAutoprint else force)({ # examplesIf
+ ## End(Don't show)
+
+ # fit models
+ a <- lm(mpg ~ wt + qsec + disp, mtcars)
+ b <- lm(mpg ~ wt + qsec, mtcars)
+
+ mod <- anova(a, b)
+
+ # summarize model fit with tidiers
+ tidy(mod)
+ glance(mod)
+
+ # car::linearHypothesis() example
+ library(car)
+ mod_lht <- linearHypothesis(a, "wt - disp")
+ tidy(mod_lht)
+ glance(mod_lht)
+ ## Don't show:
+ }) # examplesIf
> a <- lm(mpg ~ wt + qsec + disp, mtcars)
> b <- lm(mpg ~ wt + qsec, mtcars)
> mod <- anova(a, b)
> tidy(mod)
# A tibble: 2 × 7
term df.residual rss df sumsq statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 mpg ~ wt + qsec + disp 28 195. NA NA NA NA
2 mpg ~ wt + qsec 29 195. -1 -0.00102 0.000147 0.990
> glance(mod)
# A tibble: 1 × 2
deviance df.residual
<dbl> <dbl>
1 195. 29
> library(car)
Loading required package: carData
> mod_lht <- linearHypothesis(a, "wt - disp")
> tidy(mod_lht)
Error in strsplit(x_attr$heading[grep("Response", x_attr$heading)], "\n")[[1]] :
subscript out of bounds
Calls: <Anonymous> ... eval -> eval -> tidy -> tidy.anova -> sub -> is.factor
Execution halted
This pull request has been automatically locked. If you believe the issue addressed here persists, please file a new PR (with a reprex: https://reprex.tidyverse.org) and link to this one.
Closes #1205.