@@ -559,8 +559,8 @@ post_analyze <- function(o, .truth) {
559559 #post-process the object returned by boot.ci
560560 method = c("normal", "basic", "student", "percent", "bca")
561561 ret = o[method]
562- lower = unlist(purrr::map(ret, ~dplyr::nth(.x, -2)))
563- upper = sapply( ret, dplyr::last )
562+ lower = unlist(purrr::map(ret, ~dplyr::nth(.x[1,] , -2)))
563+ upper = unlist(purrr::map( ret, ~ dplyr::nth(.x[1,], -1)) )
564564 type = paste("boot", method, sep = "_")
565565
566566 return(
@@ -657,8 +657,8 @@ bootstrap_ci <- function(x, conf.level, R = 999) {
657657 ci <- boot::boot.ci(b, conf = conf.level, type = "all")
658658 method = c("normal", "basic", "student", "percent", "bca")
659659 ret = ci[method]
660- lower = unlist(purrr::map(ret, ~dplyr::nth(.x, -2)))
661- upper = sapply( ret, dplyr::last )
660+ lower = unlist(purrr::map(ret, ~dplyr::nth(.x[1,] , -2)))
661+ upper = unlist(purrr::map( ret, ~ dplyr::nth(.x[1,], -1)) )
662662 type = paste("boot", method, sep = "_")
663663
664664 # unify return
0 commit comments