Skip to content
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

test failure re: augment.betareg() #1216

Closed
simonpcouch opened this issue Sep 26, 2024 · 3 comments
Closed

test failure re: augment.betareg() #1216

simonpcouch opened this issue Sep 26, 2024 · 3 comments

Comments

@simonpcouch
Copy link
Collaborator

── Error ('test-betareg.R:45:3'): augment.betareg ──────────────────────────────
Error in `data.frame(..., check.names = FALSE)`: arguments imply differing number of rows: 6, 32
Backtrace:
    ▆
 1. └─modeltests::check_augment_function(...) at test-betareg.R:45:3
 2.   └─modeltests:::check_augment_data_specification(...)
 3.     └─broom (local) aug(model, data = head_dl$tibble, newdata = head_new_dl$tibble)
 4.       └─broom::augment_columns(...) at broom/R/betareg-tidiers.R:80:3
 5.         ├─tibble::as_tibble(cbind(original, ret)) at broom/R/utilities.R:319:5
 6.         └─base::cbind(original, ret) at broom/R/utilities.R:319:5
 7.           └─base::cbind(deparse.level, ...)
 8.             └─base::data.frame(..., check.names = FALSE)
@simonpcouch
Copy link
Collaborator Author

A more minimal reprex:

library(broom)
library(betareg)
data("GasolineYield")

fit1 <- betareg(yield ~ batch + temp, data = GasolineYield)
augment(fit1, newdata = head(GasolineYield))
#> Error in data.frame(..., check.names = FALSE): arguments imply differing number of rows: 6, 32

# fine if uses newdata with the same number of rows
augment(fit1, data = NULL, newdata = GasolineYield)
#> # A tibble: 32 × 7
#>    yield gravity pressure temp10  temp batch .fitted
#>    <dbl>   <dbl>    <dbl>  <dbl> <dbl> <fct>   <dbl>
#>  1 0.122    50.8      8.6    190   205 1      0.101 
#>  2 0.223    50.8      8.6    190   275 1      0.195 
#>  3 0.347    50.8      8.6    190   345 1      0.343 
#>  4 0.457    50.8      8.6    190   407 1      0.508 
#>  5 0.08     40.8      3.5    210   218 2      0.0797
#>  6 0.131    40.8      3.5    210   273 2      0.137 
#>  7 0.266    40.8      3.5    210   347 2      0.263 
#>  8 0.074    40        6.1    217   212 3      0.0943
#>  9 0.182    40        6.1    217   272 3      0.167 
#> 10 0.304    40        6.1    217   340 3      0.298 
#> # ℹ 22 more rows

Created on 2024-09-26 with reprex v2.1.1

@simonpcouch
Copy link
Collaborator Author

Works fine with pak::pak("cran/[email protected]"), newly errors with pak::pak("cran/[email protected]"). Current release is 3.2-1.

Copy link

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant