diff --git a/DESCRIPTION b/DESCRIPTION index 62e597123..5d46bf056 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: datawizard Title: Easy Data Wrangling and Statistical Transformations -Version: 0.12.3 +Version: 0.12.3.1 Authors@R: c( person("Indrajeet", "Patil", , "patilindrajeet.science@gmail.com", role = "aut", comment = c(ORCID = "0000-0003-1995-6531", Twitter = "@patilindrajeets")), diff --git a/R/reshape_ci.R b/R/reshape_ci.R index 99a670a2d..e1e60c4bf 100644 --- a/R/reshape_ci.R +++ b/R/reshape_ci.R @@ -44,14 +44,18 @@ reshape_ci <- function(x, ci_type = "CI") { if (length(unique(x$CI)) > 1) { if ("Parameter" %in% names(x)) { remove_parameter <- FALSE + } else if (!is.null(attr(x, "idvars"))) { + idvar <- attr(x, "idvars") + remove_parameter <- FALSE } else { + idvar <- "Parameter" x$Parameter <- NA remove_parameter <- TRUE } x <- stats::reshape( x, - idvar = "Parameter", + idvar = idvar, timevar = "CI", direction = "wide", v.names = c(ci_low, ci_high),