From db79b81aa6c6fe4dc54186045c298602b895f6d9 Mon Sep 17 00:00:00 2001 From: Guilherme Jacob Date: Tue, 31 Oct 2023 10:08:57 +0000 Subject: [PATCH 1/2] change print to account for replicate stat with `return.replicates = TRUE` --- R/all_funs.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/all_funs.R b/R/all_funs.R index e5698b8..c1c07f4 100644 --- a/R/all_funs.R +++ b/R/all_funs.R @@ -185,6 +185,11 @@ T_fn <- #' @method print cvystat #' @export print.cvystat <- function(x, ...) { + + if ( inherits( x , "svrepstat" ) & is.list(x)) { + x <- x[[1]] + } + vv <- attr(x, "var") if (attr(x, "statistic") %in% c("alkire-foster", "bourguignon-chakravarty", "bourguignon")) { From 0c6e08b80faa37a3ee62b0ce304b785e82ce33b5 Mon Sep 17 00:00:00 2001 From: Guilherme Jacob Date: Tue, 31 Oct 2023 10:08:57 +0000 Subject: [PATCH 2/2] change print to account for replicate stat with `return.replicates = TRUE` --- R/all_funs.R | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/R/all_funs.R b/R/all_funs.R index e5698b8..5ea20cb 100644 --- a/R/all_funs.R +++ b/R/all_funs.R @@ -185,6 +185,11 @@ T_fn <- #' @method print cvystat #' @export print.cvystat <- function(x, ...) { + + if ( inherits( x , "svrepstat" ) & is.list(x)) { + x <- x[[1]] + } + vv <- attr(x, "var") if (attr(x, "statistic") %in% c("alkire-foster", "bourguignon-chakravarty", "bourguignon")) { @@ -222,6 +227,9 @@ print.cvystat <- function(x, ...) { #' @export vcov.cvystat <- function (object, ...) { + if ( inherits( x , "svrepstat" ) & is.list(x)) { + x <- x[[1]] + } as.matrix(attr(object, "var")) }