statisfactions / simpr

Tidyverse-friendly simulations and power analysis
42 stars 6 forks source link

Warning re: as_tibble on a vector #21

Closed statisfactions closed 2 years ago

statisfactions commented 4 years ago

When running the following test:

test_that("calc_glance correctly returns broom::glance output", {
  ## Reference
  set.seed(100)
  x1 = 2 + rnorm(10)
  x2 = x1 + rnorm(10)

  broom_target = broom::glance(lm(x2 ~ x1))

  ## calc_glance
  set.seed(100)
  lin_test = variables(y1 = ~ 2 + rnorm(10),
            y2 = ~ y1 + rnorm(10)) %>%
    gen(1) %>%
    fit(linear = ~ lm(y2 ~ y1, data = .)) %>%
    calc_glance

  lin_test %>%
    select(-rep, -Source) %>%
    as_tibble %>%
    expect_identical(broom_target)

})

I get the following warning:

test_calc_glance.R:14: warning: calc_glance correctly returns broom::glance output
Calling `as_tibble()` on a vector is discouraged, because the behavior is likely to change in the future. Use `tibble::enframe(name = NULL)` instead.
This warning is displayed once per session.
statisfactions commented 2 years ago

Way outdated bug report. Cannot reproduce.