Running examples in ‘tidyfinance-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: estimate_fama_macbeth
> ### Title: Estimate Fama-MacBeth Regressions
> ### Aliases: estimate_fama_macbeth
> 
> ### ** Examples
> 
> set.seed(1234)
> 
> data <- tibble::tibble(
+   date = rep(seq.Date(from = as.Date("2020-01-01"),
+                       to = as.Date("2020-12-01"), by = "month"), each = 50),
+   permno = rep(1:50, times = 12),
+   ret_excess = rnorm(600, 0, 0.1),
+   beta = rnorm(600, 1, 0.2),
+   bm = rnorm(600, 0.5, 0.1),
+   log_mktcap = rnorm(600, 10, 1)
+ )
> 
> estimate_fama_macbeth(data, "ret_excess ~ beta + bm + log_mktcap")
Error in ar.ols(x, aic = aic, order.max = order.max, na.action = na.action,  : 
  non-conformable arguments
Error in `mutate()`:
ℹ In argument: `standard_error = purrr::map_dbl(model,
  ~compute_standard_error(., vcov, vcov_options))`.
Caused by error in `purrr::map_dbl()`:
ℹ In index: 1.
Caused by error in `bwNeweyWest()`:
! VAR(1) prewhitening of estimating functions failed
Backtrace:
     ▆
  1. ├─tidyfinance::estimate_fama_macbeth(data, "ret_excess ~ beta + bm + log_mktcap")
  2. │ ├─dplyr::select(...)
  3. │ ├─dplyr::mutate(...)
  4. │ ├─dplyr::mutate(...)
  5. │ └─dplyr:::mutate.data.frame(...)
  6. │   └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
  7. │     ├─base::withCallingHandlers(...)
  8. │     └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
  9. │       └─mask$eval_all_mutate(quo)
 10. │         └─dplyr (local) eval()
 11. ├─purrr::map_dbl(model, ~compute_standard_error(., vcov, vcov_options))
 12. │ └─purrr:::map_("double", .x, .f, ..., .progress = .progress)
 13. │   ├─purrr:::with_indexed_errors(...)
 14. │   │ └─base::withCallingHandlers(...)
 15. │   ├─purrr:::call_with_cleanup(...)
 16. │   └─tidyfinance (local) .f(.x[[i]], ...)
 17. │     └─tidyfinance (local) compute_standard_error(., vcov, vcov_options)
 18. │       ├─base::do.call(sandwich::NeweyWest, c(list(model), vcov_options))
 19. │       └─sandwich (local) `<fn>`(`<lm>`)
 20. │         └─sandwich::bwNeweyWest(...)
 21. │           └─base::stop(...)
 22. └─base::.handleSimpleError(...)
 23.   └─purrr (local) h(simpleError(msg, call))
 24.     └─cli::cli_abort(...)
 25.       └─rlang::abort(...)
Execution halted
Examples with CPU (user + system) or elapsed time > 5s
                user system elapsed
estimate_betas 5.754  0.244   7.298