diff --git a/R/params.R b/R/params.R index 1b0f64f..d4deb7f 100644 --- a/R/params.R +++ b/R/params.R @@ -17,7 +17,8 @@ #' @param nas A flag specifying whether to also fill missing values. #' @param parameters A character vector (or NULL) of the parameters to subset by. #' @param iterations An integer vector (or NULL) of the iterations to subset by. -#' @param simplify A flag specifying whether to drop sd and zscore columns. +#' @param simplify A flag specifying whether to drop the sd and zscore +#' columns. `simplify = FALSE` is deprecated. #' @param directional_information A flag specifying whether the svalue column #' should be calculated using [extras::directional_information()] instead of #' [extras::svalue()]. diff --git a/R/tidy.R b/R/tidy.R index fc9cfa1..f025ec3 100644 --- a/R/tidy.R +++ b/R/tidy.R @@ -22,7 +22,7 @@ warn_default_directional_information <- function( #' @export tidy.mcmc <- function( x, - simplify = FALSE, + simplify = TRUE, directional_information = FALSE, ... ) { @@ -43,7 +43,7 @@ tidy.mcmc <- function( #' @export tidy.mcmc.list <- function( x, - simplify = FALSE, + simplify = TRUE, directional_information = FALSE, ... ) { @@ -73,7 +73,7 @@ tidy.mcmc.list <- function( #' ), simplify = TRUE, directional_information = TRUE) tidy.nlists <- function( x, - simplify = FALSE, + simplify = TRUE, directional_information = FALSE, ... ) { diff --git a/man/params.Rd b/man/params.Rd index 6b8ef81..510ed76 100644 --- a/man/params.Rd +++ b/man/params.Rd @@ -35,7 +35,8 @@ for each term element.} \item{iterations}{An integer vector (or NULL) of the iterations to subset by.} -\item{simplify}{A flag specifying whether to drop sd and zscore columns.} +\item{simplify}{A flag specifying whether to drop the sd and zscore +columns. \code{simplify = FALSE} is deprecated.} \item{directional_information}{A flag specifying whether the svalue column should be calculated using \code{\link[extras:directional_information]{extras::directional_information()}} instead of diff --git a/man/tidy.mcmc.Rd b/man/tidy.mcmc.Rd index 125869d..bfd9382 100644 --- a/man/tidy.mcmc.Rd +++ b/man/tidy.mcmc.Rd @@ -4,12 +4,13 @@ \alias{tidy.mcmc} \title{Turn an object into a tidy tibble} \usage{ -\method{tidy}{mcmc}(x, simplify = FALSE, directional_information = FALSE, ...) +\method{tidy}{mcmc}(x, simplify = TRUE, directional_information = FALSE, ...) } \arguments{ \item{x}{An object.} -\item{simplify}{A flag specifying whether to drop sd and zscore columns.} +\item{simplify}{A flag specifying whether to drop the sd and zscore +columns. \code{simplify = FALSE} is deprecated.} \item{directional_information}{A flag specifying whether the svalue column should be calculated using \code{\link[extras:directional_information]{extras::directional_information()}} instead of diff --git a/man/tidy.mcmc.list.Rd b/man/tidy.mcmc.list.Rd index 673cba2..1ae48e3 100644 --- a/man/tidy.mcmc.list.Rd +++ b/man/tidy.mcmc.list.Rd @@ -4,12 +4,13 @@ \alias{tidy.mcmc.list} \title{Turn an object into a tidy tibble} \usage{ -\method{tidy}{mcmc.list}(x, simplify = FALSE, directional_information = FALSE, ...) +\method{tidy}{mcmc.list}(x, simplify = TRUE, directional_information = FALSE, ...) } \arguments{ \item{x}{An object.} -\item{simplify}{A flag specifying whether to drop sd and zscore columns.} +\item{simplify}{A flag specifying whether to drop the sd and zscore +columns. \code{simplify = FALSE} is deprecated.} \item{directional_information}{A flag specifying whether the svalue column should be calculated using \code{\link[extras:directional_information]{extras::directional_information()}} instead of diff --git a/man/tidy.nlists.Rd b/man/tidy.nlists.Rd index ef2b90a..2d90631 100644 --- a/man/tidy.nlists.Rd +++ b/man/tidy.nlists.Rd @@ -4,12 +4,13 @@ \alias{tidy.nlists} \title{Turn an object into a tidy tibble} \usage{ -\method{tidy}{nlists}(x, simplify = FALSE, directional_information = FALSE, ...) +\method{tidy}{nlists}(x, simplify = TRUE, directional_information = FALSE, ...) } \arguments{ \item{x}{An object.} -\item{simplify}{A flag specifying whether to drop sd and zscore columns.} +\item{simplify}{A flag specifying whether to drop the sd and zscore +columns. \code{simplify = FALSE} is deprecated.} \item{directional_information}{A flag specifying whether the svalue column should be calculated using \code{\link[extras:directional_information]{extras::directional_information()}} instead of diff --git a/tests/testthat/test-tidy.R b/tests/testthat/test-tidy.R index 880d3b9..dce2d5e 100644 --- a/tests/testthat/test-tidy.R +++ b/tests/testthat/test-tidy.R @@ -1,10 +1,12 @@ test_that("tidy.nlists", { rlang::local_options(lifecycle_verbosity = "quiet") - lifecycle::expect_deprecated(tidy(nlists(), directional_information = FALSE)) + lifecycle::expect_deprecated( + tidy(nlists(), simplify = FALSE, directional_information = FALSE) + ) expect_identical( - tidy(nlists()), + tidy(nlists(), simplify = FALSE), structure( list( term = structure( @@ -30,7 +32,7 @@ test_that("tidy.nlists", { ) ) expect_equal( - tidy(nlists(nlist())), + tidy(nlists(nlist()), simplify = FALSE), tibble::tibble( term = term(x = 0), estimate = numeric(0), @@ -42,7 +44,7 @@ test_that("tidy.nlists", { ) ) expect_identical( - tidy(nlists(nlist(x = 2))), + tidy(nlists(nlist(x = 2)), simplify = FALSE), tibble::tibble( term = term("x"), estimate = 2, @@ -54,7 +56,7 @@ test_that("tidy.nlists", { ) ) expect_identical( - tidy(nlists(nlist(x = 2:4))), + tidy(nlists(nlist(x = 2:4)), simplify = FALSE), tibble::tibble( term = term(x = 3), estimate = c(2, 3, 4), @@ -74,7 +76,7 @@ test_that("tidy.nlists", { ) ) expect_identical( - tidy(nlists(nlist(y = 1, s = 1:2))), + tidy(nlists(nlist(y = 1, s = 1:2)), simplify = FALSE), tibble::tibble( term = term("y", s = 2), estimate = c(1, 1, 2), @@ -94,7 +96,10 @@ test_that("tidy.nlists", { ) ) expect_equal( - tidy(nlists(nlist(x = 1, y = 1:2), nlist(x = 1, y = 3:4))), + tidy( + nlists(nlist(x = 1, y = 1:2), nlist(x = 1, y = 3:4)), + simplify = FALSE + ), tibble::tibble( term = term("x" = 1, y = 2), estimate = c(1, 2, 3), @@ -115,6 +120,18 @@ test_that("tidy.nlists", { ) }) +test_that("tidy.nlists default is simplify = TRUE", { + rlang::local_options(lifecycle_verbosity = "quiet") + expect_identical( + tidy(nlists(nlist(x = 2))), + tidy(nlists(nlist(x = 2)), simplify = TRUE, directional_information = FALSE) + ) + expect_identical( + colnames(tidy(nlists(nlist(x = 2)))), + c("term", "estimate", "lower", "upper", "svalue") + ) +}) + test_that("tidy.nlists", { expect_identical( tidy(nlists(), simplify = TRUE, directional_information = FALSE),