From 65e3c51303e79abb2c02096092e40662294d9b9c Mon Sep 17 00:00:00 2001 From: laurabrianna Date: Thu, 15 Aug 2024 14:52:07 -0700 Subject: [PATCH] update param in use_data & related test for default version 3 --- R/data.R | 6 +++--- man/use_data.Rd | 6 +++--- tests/testthat/test-data.R | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/R/data.R b/R/data.R index b14e7759d..e19cb04b7 100644 --- a/R/data.R +++ b/R/data.R @@ -18,9 +18,9 @@ #' files. If you really want to do so, set this to `TRUE`. #' @param compress Choose the type of compression used by [save()]. #' Should be one of "gzip", "bzip2", or "xz". -#' @param version The serialization format version to use. The default, 2, was -#' the default format from R 1.4.0 to 3.5.3. Version 3 became the default from -#' R 3.6.0 and can only be read by R versions 3.5.0 and higher. +#' @param version The serialization format version to use. The default, 3, can +#' only be read by R versions 3.5.0 and higher. For R 1.4.0 to 3.5.3, use +#' version 2. #' @inheritParams base::save #' #' @seealso The [data chapter](https://r-pkgs.org/data.html) of [R diff --git a/man/use_data.Rd b/man/use_data.Rd index ae1b5fb83..5f5fc1f39 100644 --- a/man/use_data.Rd +++ b/man/use_data.Rd @@ -35,9 +35,9 @@ files. If you really want to do so, set this to \code{TRUE}.} \item{compress}{Choose the type of compression used by \code{\link[=save]{save()}}. Should be one of "gzip", "bzip2", or "xz".} -\item{version}{The serialization format version to use. The default, 2, was -the default format from R 1.4.0 to 3.5.3. Version 3 became the default from -R 3.6.0 and can only be read by R versions 3.5.0 and higher.} +\item{version}{The serialization format version to use. The default, 3, can +only be read by R versions 3.5.0 and higher. For R 1.4.0 to 3.5.3, use +version 2.} \item{ascii}{if \code{TRUE}, an ASCII representation of the data is written. The default value of \code{ascii} is \code{FALSE} which diff --git a/tests/testthat/test-data.R b/tests/testthat/test-data.R index dfe2b017d..f2f893aee 100644 --- a/tests/testthat/test-data.R +++ b/tests/testthat/test-data.R @@ -62,14 +62,14 @@ test_that("use_data() honors `overwrite` for internal data", { expect_identical(letters2, rev(letters)) }) -test_that("use_data() writes version 2 by default", { +test_that("use_data() writes version 3 by default", { create_local_package() x <- letters - use_data(x, internal = TRUE, version = 2, compress = FALSE) + use_data(x, internal = TRUE, compress = FALSE) expect_identical( rawToChar(readBin(proj_path("R", "sysdata.rda"), n = 4, what = "raw")), - "RDX2" + "RDX3" ) })